load_dataset#

movement.io.load.load_dataset(file, source_software='auto', fps=None, **kwargs)[source]#

Create a movement dataset from any supported file format.

Parameters:
  • file (Path | str | NWBFile) – Path to a file containing pose or bounding box tracks, in one of the supported formats. If source_software is “NWB”, this can also be a pynwb.file.NWBFile object.

  • source_software (Literal['DeepLabCut', 'SLEAP', 'LightningPose', 'Anipose', 'NWB', 'VIA-tracks', 'COCO', 'movement'] | Literal['auto', 'DeepLabCut/LightningPose']) – The source software of the file. If set to "auto" (default), it is inferred from the file format via infer_source_software(). Use get_supported_source_software() to list all registered source software names and their supported file suffixes.

  • fps (float | None) – The number of frames per second in the video. If None (default), the time coordinates will be in frame numbers. This argument is ignored when source_software is “NWB” or “movement”, as the frame rate will be directly read or estimated from metadata in the file.

  • **kwargs – Additional keyword arguments passed to the format-specific loader in movement.io.load_poses or movement.io.load_bboxes, or to xarray.load_dataset() for movement netCDF files.

Returns:

movement dataset containing the pose or bounding box tracks, confidence scores, and associated metadata.

Return type:

Dataset

See also

load_multiview_dataset

Load and merge data from multiple views.

movement.io.save.save_dataset

Save a movement dataset to a file.

Examples

>>> from movement.io import load_dataset
>>> ds = load_dataset(
...     "path/to/file.h5", source_software="DeepLabCut", fps=30
... )