diplomat.frontends.deeplabcut.predict_videos_dlc.analyze_videos

diplomat.frontends.deeplabcut.predict_videos_dlc.analyze_videos(config: PathLike | str, videos: List[PathLike | str] | PathLike | str, video_type: str = '', shuffle: int = 1, training_set_index: int = 0, gpu_index: int | None = None, save_as_csv: bool = False, destination_folder: str | None = None, batch_size: int | None = None, cropping: Tuple[int, int, int, int] | None = None, model_prefix: str = '', num_outputs: int | None = None, multi_output_format: Literal['default', 'separate'] = 'default', predictor: str | None = None, predictor_settings: Dict[str, Any] | None = None) None[source]

Run DIPLOMAT tracking on videos using a DEEPLABCUT project and trained network.

Parameters:
  • config – The path to the DLC config for the DEEPLABCUT project.

  • videos – A single path or list of paths, to the location of video files to run analysis on. Can also be a directory.

  • video_type – Optional string, the video extension to search for if the ‘videos’ argument is a directory to search inside (‘.avi’, ‘.mp4’, …).

  • shuffle – int, optional. Integer specifying which TrainingsetFraction to use. By default, the first (note that TrainingFraction is a list in config.yaml).

  • training_set_index – int, optional. Integer specifying which TrainingsetFraction to use. By default the first (note that TrainingFraction is a list in config.yaml).

  • gpu_index – Integer index of the GPU to use for inference (in tensorflow) defaults to 0, or selecting the first detected GPU if available.

  • save_as_csv – Boolean, if true save the results to both a HDF5 file (“.h5”) and also a CSV file, otherwise only save results to a HDF5.

  • destination_folder – The destination folder to save the resulting HDF5 track files to. Defaults to None, meaning save the HDF5 in the same folder as the video file it was generated from.

  • batch_size – The batch size to use while processing. Defaults to None, which uses the default batch size for the project.

  • cropping – A tuple of 4 integers in the format (x1, x2, y1, y2), specifying the boundaries of the cropping box analyze in the video. Defaults to None, which uses the cropping settings in the DLC config file.

  • model_prefix – The string prefix of the DEEPLABCUT model to use defaults to no prefix (the default model).

  • num_outputs – The number of outputs, or bodies to track in the video. Defaults to the value specified in the DLC config, or None if one is not specified.

  • multi_output_format – The format to use when tracking multiple body parts of the same type (multiple bodies, or num_outputs > 1). Defaults to “default”, which uses DLC’s original multi-output format. Passing “separate” saves additional bodies by tacking on an index onto to body part name (Nose, Nose2, Nose3, …) instead of storing tracks for the same body part type together.

  • predictor – A String, the name of the predictor plugin to be used to make predictions. If not specified, defaults to the segmented frame pass engine (“SegmentedFramePassEngine”).

  • predictor_settings – Optional dictionary of strings to any. This will specify what settings a predictor should use, completely ignoring any settings specified in the config.yaml. Default value is None, which tells this method to use the settings specified in the config.yaml.