DIPLOMAT API

DIPLOMAT includes the following python interfaces and plugins below.

Core Functions

Python functions that are equivalents for DIPLOMAT’s command line interface.

list_predictor_plugins()

Retrieve and print all currently installed and available predictor plugins that can be used with deeplabcut to the console...

get_predictor_settings([predictor])

Gets the available/modifiable settings for a specified predictor plugin.

test_predictor_plugin([predictor, interactive])

Run the tests for a predictor plugin.

list_all_frontends()

List all frontends currently included with this version of DIPLOMAT.

list_loaded_frontends()

List frontends that have successfully loaded, and list their supported functions.

split_videos(videos[, seconds_per_segment, ...])

Split a video into even length segments.

track(config[, videos, frame_stores, ...])

Run DIPLOMAT tracking on videos and/or frame stores.

supervised(config[, videos, frame_stores, ...])

Run diplomat in supervised mode on the specified config and videos or frame stores.

unsupervised(config[, videos, frame_stores, ...])

Run diplomat in unsupervised mode on the specified config and videos or frame stores.

annotate(config[, videos, help_extra])

Have diplomat annotate, or label a video given it has already been tracked.

tweak(config[, videos, help_extra])

Make modifications to DIPLOMAT produced tracking results created for a video using a limited version supervised labeling UI.

yaml([run_config])

Run DIPLOMAT based on a passed yaml run script.

Predictors

A list of the Predictor plugins included with DIPLOMAT by default. Predictors predict the exact locations of objects given probabilistic model outputs.

PlotterArgMax

Identical to ArgMax, but plots probability frames in form of video to the user using matplotlib…

ArgMax

Default processor for DeepLabCut, and the code originally used by DeepLabCut for prediction of points. Predicts the point from the probability frames simply by selecting the max probability in each frame.

SupervisedFramePassEngine

A predictor that applies the frame pass engine to frames in order to predict poses. This version includes an additional GUI for previewing and modifying results before saving them.

FastPlotterArgMax

Identical to PlotterArgMax, but avoids using matplotlib to generate probability maps, and instead directly uses cv2 to generate the plots. This means it runs much faster, but doesn’t offer as much customization nor a 3D mode…

SupervisedSegmentedFramePassEngine

The supervised version of the SegmentedFramePassEngine predictor. Provides a GUI for modifying results at the end of the tracking process.

SegmentedFramePassEngine

A predictor that applies a collection of frame passes to the frames dumped by deeplabcut, and then predicts poses by selecting maximums. Contains a collection of useful prediction algorithms which can be listed by calling “get_predictor_settings” on this Predictor. This version applies passes in segments, and then stitches those segments together.

FramePassEngine

A predictor that applies a collection of frame passes to the frames dumped by deeplabcut, and then predicts poses by selecting maximums. Contains a collection of useful prediction algorithms which can be listed by calling “get_predictor_settings” on this Predictor.

FrameExporter

Exports DeepLabCut probability maps to a binary format that can be passed back into DeepLabCut again to perform frame predictions later. This allows for a video to be run through the neural network (expensive) on a headless server or supercomputer, and then run through a predictor with gui feedback on a laptop or somewhere else.

Frame Passes

A list of the FramePass plugins included by default with DIPLOMAT. Some Predictor plugins use frame passes to perform pose prediction, including the FramePassEngine and SegmentedFramePassEngine based predictors.

FixFrame

Scores frames by peak separation, and then selects a single frame to remain clustered (with peaks separated). The rest of the frames are restored, and MITViterbi uses the fixed frame as it’s ground truth frame.

ClusterFrames

Breaks up each frame and separates it into a fixed number of frames, where each frame contains typically a single peak.

CreateSkeleton

Computes optimal skeletal link distances and then constructs a skeleton to be used by MITViterbi. The links can be passed directly to this frame pass or are otherwise inferred from the config file.

OptimizeStandardDeviation

Runs across the video and determines the optimal value for the standard deviation for the 2D gaussian transition function used in MITViterbi.

MITViterbi

An implementation of the Multi-Individual Tracking Viterbi algorithm. Runs a viterbi-like algorithm across the frames to determine the maximum scoring paths per individual, assuming an individuals can’t take a paths that would have been more likely for other individuals to have taken.

Processing Module

diplomat.processing

This module defines the abstract base class for predictor plugins, and additional data structures, classes, and functions used for processing network outputs into body part pose predictions.

Utilities

diplomat.utils

This module includes general utility classes and functions used extensively in diplomat.

Frontends

A list of frontends that come included with DIPLOMAT. Frontends enable DIPLOMAT to run off of model results produced by a specific tracking software package and project.

deeplabcut

The DEEPLABCUT frontend for DIPLOMAT. Contains functions for running DIPLOMAT on DEEPLABCUT projects.

sleap

The SLEAP frontend for DIPLOMAT. Contains functions for running DIPLOMAT on SLEAP projects.