Python API ========== DIPLOMAT includes the following python interfaces and plugins below. Core Functions -------------- Python functions that are equivalents for DIPLOMAT's command line interface. .. autosummary:: :toctree: _autosummary :recursive: ~diplomat.list_predictor_plugins ~diplomat.get_predictor_settings ~diplomat.test_predictor_plugin ~diplomat.list_all_frontends ~diplomat.list_loaded_frontends ~diplomat.split_videos ~diplomat.track_with ~diplomat.track_and_interact ~diplomat.track ~diplomat.annotate ~diplomat.tweak ~diplomat.yaml ~diplomat.interact ~diplomat.convert_tracks Predictors ---------- A list of the :class:`~diplomat.processing.Predictor` plugins included with DIPLOMAT by default. Predictors predict the exact locations of objects given probabilistic model outputs. .. toctree:: :hidden: _autosummary/diplomat.predictors.SegmentedFramePassEngine _autosummary/diplomat.predictors.FastPlotterArgMax _autosummary/diplomat.predictors.SupervisedSegmentedFramePassEngine _autosummary/diplomat.predictors.PlotterArgMax _autosummary/diplomat.predictors.FrameExporter _autosummary/diplomat.predictors.ArgMax .. list-table:: :widths: auto * - :py:plugin:`~diplomat.predictors.SegmentedFramePassEngine` - A predictor that applies a collection of frame passes to the frames dumped by image recognition models, 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. * - :py:plugin:`~diplomat.predictors.FastPlotterArgMax` - Identical to :py:plugin:`~diplomat.predictors.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... * - :py:plugin:`~diplomat.predictors.SupervisedSegmentedFramePassEngine` - The supervised (aka interactive) version of the :plugin:`~diplomat.predictors.SegmentedFramePassEngine` predictor. Provides a GUI for modifying results at the end of the tracking process. * - :py:plugin:`~diplomat.predictors.PlotterArgMax` - Identical to :plugin:`~diplomat.predictors.ArgMax`, but plots probability frames in form of video to the user using matplotlib... * - :py:plugin:`~diplomat.predictors.FrameExporter` - Exports probability maps to a binary format that can be passed back into DIPLOMAT 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. * - :py:plugin:`~diplomat.predictors.ArgMax` - Dummy predictor for DIPLOMAT. Predicts the point from the probability frames simply by selecting the max probability in each frame. .. _Frame Passes: Frame Passes ------------ A list of the ``FramePass`` plugins included by default with DIPLOMAT. Some :class:`~diplomat.processing.Predictor` plugins use frame passes to perform pose prediction, including the :plugin:`~diplomat.predictors.SegmentedFramePassEngine` and :plugin:`~diplomat.predictors.SupervisedSegmentedFramePassEngine` based predictors. .. toctree:: :hidden: _autosummary/diplomat.predictors.frame_passes.CreateSkeleton _autosummary/diplomat.predictors.frame_passes.OptimizeStandardDeviation _autosummary/diplomat.predictors.frame_passes.FixFrame _autosummary/diplomat.predictors.frame_passes.MITViterbi _autosummary/diplomat.predictors.frame_passes.ClusterFrames .. list-table:: :widths: auto * - :py:plugin:`~diplomat.predictors.frame_passes.CreateSkeleton` - Computes optimal skeletal link distances and then constructs a skeleton to be used by :py:plugin:`~diplomat.predictors.frame_passes.MITViterbi`. The links can be passed directly to this frame pass or are otherwise inferred from the config file. * - :py:plugin:`~diplomat.predictors.frame_passes.OptimizeStandardDeviation` - Runs across the video and determines the optimal value for the standard deviation for the 2D gaussian transition function used in :py:plugin:`~diplomat.predictors.frame_passes.MITViterbi`. * - :py:plugin:`~diplomat.predictors.frame_passes.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 :py:plugin:`~diplomat.predictors.frame_passes.MITViterbi` uses the fixed frame as it's ground truth frame. * - :py:plugin:`~diplomat.predictors.frame_passes.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. * - :py:plugin:`~diplomat.predictors.frame_passes.ClusterFrames` - Breaks up each frame and separates it into a fixed number of frames, where each frame contains typically a single peak. Processing Module ----------------- .. autosummary:: :toctree: _autosummary :template: custom-module-template.rst :recursive: diplomat.processing Utilities --------- .. autosummary:: :toctree: _autosummary :template: custom-module-template.rst :recursive: diplomat.utils 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. .. toctree:: :hidden: _autosummary/diplomat.sleap _autosummary/diplomat.deeplabcut .. list-table:: :widths: auto * - :py:plugin:`~diplomat.sleap` - The SLEAP frontend for DIPLOMAT. Contains functions for running DIPLOMAT on SLEAP projects. * - :py:plugin:`~diplomat.deeplabcut` - The DEEPLABCUT frontend for DIPLOMAT. Contains functions for running DIPLOMAT on DEEPLABCUT projects. WX GUI Components ----------------- .. autosummary:: :toctree: _autosummary :template: custom-module-template.rst :recursive: diplomat.wx_gui