from_dlc_style_df#

movement.io.load_poses.from_dlc_style_df(df, fps=None, source_software='DeepLabCut')[source]#

Create a movement poses dataset from a DeepLabCut-style DataFrame.

Parameters:
  • df (pandas.DataFrame) – DataFrame containing the pose tracks and confidence scores. Must be formatted as in DeepLabCut output files (see Notes).

  • fps (float, optional) – The number of frames per second in the video. If None (default), the time coordinates will be in frame numbers.

  • source_software (str, optional) – Name of the pose estimation software from which the data originate. Defaults to “DeepLabCut”, but it can also be “LightningPose” (because they the same DataFrame format).

Returns:

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

Return type:

xarray.Dataset

Notes

The DataFrame must have a multi-index column with the following levels: “scorer”, (“individuals”), “bodyparts”, “coords”. The “individuals” level may be omitted if there is only one individual in the video. The “coords” level contains the spatial coordinates “x”, “y”, as well as “likelihood” (point-wise confidence scores). The row index corresponds to the frame number.