diplomat.frontends.sleap.predict_videos_sleap.analyze_videos

diplomat.frontends.sleap.predict_videos_sleap.analyze_videos(config: Union[List[Union[PathLike, str]], Union[PathLike, str]], videos: Union[List[Union[PathLike, str]], Union[PathLike, str]], batch_size: Optional[int] = None, num_outputs: Optional[int] = None, predictor: Optional[str] = None, predictor_settings: Optional[Dict[str, Any]] = None, gpu_index: Optional[int] = None, output_suffix: str = '', refinement_kernel_size: int = 5, use_cpu: bool = False, **kwargs) None[source]

Run DIPLOMAT tracking on a set of videos or a single video using a SLEAP model, generating results in “.slp” files.

Parameters:
  • config – The path (or list of paths) to the sleap model(s) used for inference, each as either as a folder or zip file.

  • videos – A path or list of paths to video files to run DIPLOMAT on using the passed SLEAP model.

  • batch_size – An integer, the number of images to pass to the model per batch.

  • num_outputs – An integer, the number of individuals in the video defaults to 1.

  • predictor – A string, the name of the predictor to use to perform the task of tracking.

  • predictor_settings – A dictionary of strings to any values, the settings to use for the predictor. Each predictor offers different settings, see diplomat predictors list_settings or get_predictor_settings() to get the settings a predictor plugin supports.

  • gpu_index – An integer, the index of the GPU to use. If not set DIPLOMAT allows SLEAP to automatically select a GPU.

  • output_suffix – A string, the suffix to append onto the output .slp file. Defaults to an empty string.

  • refinement_kernel_size – An integer, the kernel size to use for creating offset maps if they don’t exist (via integral refinement). defaults to False, if set to 0 or a negative integer disables integral refinement.

  • use_cpu – A boolean, if True force SLEAP to use the CPU to run the model. Defaults to False.

  • kwargs

    The following additional arguments are supported:

    • 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 listsof strings, or True/False (True connects all parts, False connects no parts, disabling the skeleton).