diplomat.core_ops.track

diplomat.core_ops.track(config: List[PathLike | str] | PathLike | str, videos: List[PathLike | str] | PathLike | str | None = None, frame_stores: List[PathLike | str] | PathLike | str | None = None, num_outputs: int | None = None, batch_size: int | None = None, settings: Dict[str, Any] | None = None, output_suffix: str = '', help_extra: bool = False, **extra_args) None[source]

Run diplomat in a non-interactive tracking mode on the specified config and videos or frame stores. An alias for DIPLOMAT track_with with the SegmentedFramePassEngine predictor. The interactive UI can be restored later using diplomat interact function or cli command.

Parameters:
  • config – The path to the configuration file for the project. The format of this argument will depend on the frontend.

  • videos – A single path or list of paths to video files to run analysis on.

  • frame_stores – A single path or list of paths to frame store files to run analysis on.

  • num_outputs – An integer, the number of bodies to track in the video. If not set the frontend will try to pull it from the project configuration.

  • batch_size – An integer, the number of frame to process at a single time. If not set the frontend will try to pull it from the project configuration.

  • settings – An optional dictionary, listing the settings to use for the specified predictor plugin instead of the defaults. If not specified, the frontend will determine the settings in a frontend specific manner. To see the settings a predictor plugin supports, use the “diplomat predictors list_settings” command or “diplomat.get_predictor_settings” function. To get more information about how a frontend gets settings if not passed, set the help_extra parameter to True to print additional settings for the selected frontend instead of running tracking.

  • output_suffix – String, a suffix to append to name of the output file. Defaults to no suffix…

  • help_extra – Boolean, if set to true print extra settings for the automatically selected frontend instead of running tracking.

  • extra_args

    Any additional arguments (if the CLI, flags starting with ‘–’) are passed to the frontend, visual settings, or predictor, in that order. To see valid frontend arguments, run track with extra_help flag set to true. Additional visual arguments:

    • pcutoff (Type: RangedFloat[min=0.0, max=1.0], Default: 0.1): The probability to cutoff results below.

    • dotsize (Type: int, Default: 4): The size of the dots.

    • alphavalue (Type: RangedFloat[min=0.0, max=1.0], Default: 0.7): The alpha value of the dots.

    • colormap (Type: to_colormap, Default: None): The colormap to use for tracked points in the video. Can be a matplotlib colormap or a list of matplotlib colors.

    • shape_list (Type: Optional[List[str]], Default: None): A list of shape names, shapes to use for drawing each individual’s dots.

    • line_thickness (Type: int, Default: 1): Thickness of lines drawn.

    • skeleton (Type: Union[List[Tuple[str, str]], Dict[str, List[str]], List[str], None, bool], Default: None): The skeleton to use for this this run of DIPLOMAT. Defaults to None, which uses the skeleton associated with the sleap project. Can be a list of strings, a list of tuples of strings, a dictionary of strings to strings or lists of strings, or True/False (True connects all parts, False connects no parts, disabling the skeleton).