API Reference#

Input/Output#

from_file(file_path, source_software[, fps])

Load pose tracking data from any supported file format.

from_sleap_file(file_path[, fps])

Load pose tracking data from a SLEAP file into an xarray Dataset.

from_dlc_file(file_path[, fps])

Load pose tracking data from a DeepLabCut (DLC) output file.

from_dlc_df(df[, fps])

Create an xarray.Dataset from a DeepLabCut-style pandas DataFrame.

from_lp_file(file_path[, fps])

Load pose tracking data from a LightningPose (LP) output file.

to_dlc_file(ds, file_path[, split_individuals])

Save the xarray dataset to a DeepLabCut-style .h5 or .csv file.

to_dlc_df(ds[, split_individuals])

Convert an xarray dataset to DeepLabCut-style pandas DataFrame(s).

to_sleap_analysis_file(ds, file_path)

Save the xarray dataset to a SLEAP-style .h5 analysis file.

to_lp_file(ds, file_path)

Save the xarray dataset to a LightningPose-style .csv file (see Notes).

ValidFile(path, *[, expected_permission, ...])

Class for validating file paths.

ValidHDF5(path, *[, expected_datasets])

Class for validating HDF5 files.

ValidPosesCSV(path)

Class for validating DLC-style .csv files.

ValidPosesDataset(*, position_array[, ...])

Class for validating pose tracking data imported from a file.

Sample Data#

list_datasets()

Find available sample datasets.

fetch_dataset_paths(filename)

Get paths to sample pose data and any associated frames or videos.

fetch_dataset(filename)

Load a sample dataset containing pose data.

Filtering#

filter_by_confidence(ds[, threshold, ...])

Drop all points below a certain confidence threshold.

interpolate_over_time(ds[, method, max_gap, ...])

Fill in NaN values by interpolating over the time dimension.

report_nan_values(ds[, ds_label])

Report the number and percentage of points that are NaN.

Analysis#

compute_displacement(data)

Compute displacement between consecutive positions.

compute_velocity(data)

Compute the velocity in cartesian (x,y) coordinates.

compute_acceleration(data)

Compute acceleration in cartesian (x,y) coordinates.

cart2pol(data)

Transform Cartesian coordinates to polar.

pol2cart(data)

Transform polar coordinates to Cartesian.

MovementDataset#

MovementDataset(ds)

An xarray.Dataset accessor for pose tracking data.

Logging#

configure_logging([log_level, logger_name, ...])

Configure the logging module.

log_error(error, message[, logger_name])

Log an error message and return the Exception.

log_warning(message[, logger_name])

Log a warning message.