to_sleap_analysis_file#
- movement.io.save_poses.to_sleap_analysis_file(ds, file)[source]#
Save a
movementdataset to a SLEAP analysis file.- Parameters:
- Return type:
Notes
The output file will contain the following keys (matching the structure of SLEAP .h5 analysis files): “track_names”, “node_names”, “tracks”, “track_occupancy”, “point_scores”, “instance_scores”, “tracking_scores”, “labels_path”, “edge_names”, “edge_inds”, “video_path”, “video_ind”, “provenance” [1]. However, only “track_names”, “node_names”, “tracks” and “track_occupancy” are guaranteed to contain data extracted from the input dataset. For confidence scores, only one of “point_scores” or “instance_scores” will be populated. The other will contain default NaN values. Specifically:
“point_scores” is populated when
dscontains keypoint-wise confidence scores.“instance_scores” is populated when
dscontains individual-wise confidence scores.
“labels_path” will contain the path to the input file only if the source file of the dataset is a SLEAP .slp file. Otherwise, it will be an empty string. The other attributes and data variables that are not present in the input dataset will contain default (empty) values.
References
Examples
>>> from movement.io import save_poses, load_poses >>> ds = load_poses.from_dlc_file("path/to/file.h5") >>> save_poses.to_sleap_analysis_file( ... ds, "/path/to/file_sleap.analysis.h5" ... )