load_dataset#

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

Create a movement dataset from any supported third-party file.

Parameters:
  • file (Path | str | NWBFile) – Path to the file containing predicted poses or tracked bounding boxes. If source software is “NWB”, this can also be a pynwb.file.NWBFile object. The file format must be among those supported by the movement.io.load_poses or movement.io.load_bboxes modules. Based on the value of source_software, the appropriate loading function will be called.

  • source_software (Literal['DeepLabCut', 'SLEAP', 'LightningPose', 'Anipose', 'NWB', 'VIA-tracks']) – The source software of the file.

  • 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”, as the frame rate will be directly read or estimated from metadata in the NWB file.

  • **kwargs – Additional keyword arguments to pass to the software-specific loading functions in modules listed under “See Also”.

Returns:

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

Return type:

Dataset

Examples

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