Developer API

sleap.diagnostic

Outputs diagnostic information to help with debugging SLEAP installation.

sleap.instance

Data structures for all labeled data contained with a SLEAP project.

sleap.message

Module with classes for sending and receiving messages between processes.

sleap.prefs

Handles SLEAP preferences.

sleap.rangelist

Module with RangeList class for manipulating a list of range intervals.

sleap.skeleton

Implementation of skeleton data structure and API.

sleap.util

A miscellaneous set of utility functions.

sleap.version

Current version of SLEAP package.

sleap.gui.app

Main GUI application for labeling, training/inference, and proofreading.

sleap.gui.color

Logic for determining what color/width to draw instance nodes/edges.

sleap.gui.commands

Module for gui command context and commands objects.

sleap.gui.dataviews

Data table widgets and view models used in GUI app.

sleap.gui.shortcuts

Class for accessing/setting keyboard shortcuts.

sleap.gui.state

Module with object for storing and accessing gui state variables.

sleap.gui.suggestions

Module for generating lists of suggested frames (for labeling or reviewing).

sleap.gui.dialogs.delete

Dialog for deleting various subsets of instances in dataset.

sleap.gui.dialogs.export_clip

Dialog for exporting clip; shows message depending on available encoder.

sleap.gui.dialogs.filedialog

Wrappers for Qt File Dialogs.

sleap.gui.dialogs.formbuilder

Widgets and dialogues for YAML-based forms.

sleap.gui.dialogs.importvideos

Interface to handle the UI for importing videos.

sleap.gui.dialogs.merge

Gui for merging two labels files with options to resolve conflicts.

sleap.gui.dialogs.message

Module to show a non-blocking modal dialog box with a string message.

sleap.gui.dialogs.metrics

Dialog/widgets for showing metrics on trained models.

sleap.gui.dialogs.missingfiles

Gui for prompting the user to locate one or more missing files.

sleap.gui.dialogs.shortcuts

GUI for viewing/modifying keyboard shortcuts.

sleap.gui.learning.configs

Find, load, and show lists of saved TrainingJobConfig.

sleap.gui.learning.datagen

Preview of training data (i.e., confidence maps and part affinity fields).

sleap.gui.learning.dialog

Dialogs for running training and/or inference in GUI.

sleap.gui.learning.receptivefield

Widget for previewing receptive field on sample image using model hyperparams.

sleap.gui.learning.runners

Run training/inference in background process via CLI.

sleap.gui.learning.scopedkeydict

Conversion between flat (form data) and hierarchical (config object) dicts.

sleap.gui.overlays.anchors

Overlay for showing negative training sample anchors (currently unused).

sleap.gui.overlays.base

Base classes for overlays.

sleap.gui.overlays.confmaps

Overlay for confidence maps.

sleap.gui.overlays.instance

Overlay for showing instances.

sleap.gui.overlays.pafs

Overlay for part affinity fields.

sleap.gui.overlays.tracks

Track trail and track list overlays.

sleap.gui.widgets.imagedir

Qt widget for showing images from a directory.

sleap.gui.widgets.mpl

Widget which wraps Matplotlib canvas.

sleap.gui.widgets.multicheck

Module for Qt Widget to show multiple checkboxes for selecting.

sleap.gui.widgets.slider

Drop-in replacement for QSlider with additional features.

sleap.gui.widgets.video

Module for showing and manipulating skeleton instances within a video.

sleap.info.align

Functions to align instances.

sleap.info.feature_suggestions

Module for generating lists of frames using frame features, pca, kmeans, etc.

sleap.info.labels

Command line utility which prints data about labels file.

sleap.info.metrics

Module for producing prediction metrics for SLEAP datasets.

sleap.info.summary

Module for getting a series which gives some statistic based on labeling data for each frame of some labeled video.

sleap.info.trackcleaner

CLI for TrackCleaner (mostly deprecated).

sleap.info.write_tracking_h5

Generate an HDF5 file with track occupancy and point location data.

sleap.io.asyncvideo

Support for loading video frames (by chunk) in background process.

sleap.io.convert

Command line utility for converting between various dataset formats.

sleap.io.dataset

A SLEAP dataset collects labeled video frames, together with required metadata.

sleap.io.legacy

Module for legacy LEAP dataset.

sleap.io.pathutils

Utilities for working with file paths.

sleap.io.video

Video reading and writing interfaces for different formats.

sleap.io.videowriter

Module for writing avi/mp4 videos.

sleap.io.visuals

Module for generating videos with visual annotation overlays.

sleap.io.format.adaptor

File format adaptor base class.

sleap.io.format.coco

Adaptor for reading COCO keypoint detection datasets.

sleap.io.format.deeplabcut

Adaptor for reading DeepLabCut datasets.

sleap.io.format.deepposekit

Adaptor for reading DeepPoseKit datasets (HDF5).

sleap.io.format.dispatch

Dispatcher for dynamically supporting multiple dataset file formats.

sleap.io.format.filehandle

File object which can be passed to adaptors.

sleap.io.format.genericjson

Adaptor for reading and writing any generic JSON file.

sleap.io.format.hdf5

Adaptor for reading/writing SLEAP datasets as HDF5 (including .slp).

sleap.io.format.labels_json

Adaptor for reading/writing old, JSON dataset format (kind of deprecated).

sleap.io.format.leap_matlab

Adaptor to read (not write) LEAP MATLAB data files.

sleap.io.format.main

Read/write for multiple dataset formats.

sleap.io.format.sleap_analysis

Adaptor to read and write analysis HDF5 files.

sleap.io.format.text

Adaptor for reading and writing any generic text file.

sleap.nn.callbacks

Training-related tf.keras callbacks.

sleap.nn.evals

Evaluation utilities for measuring pose estimation accuracy.

sleap.nn.heads

Model head definitions for defining model output types.

sleap.nn.inference

Inference pipelines and utilities.

sleap.nn.losses

Custom loss functions and metrics.

sleap.nn.model

This module defines the main SLEAP model class for defining a trainable model.

sleap.nn.monitor

GUI for monitoring training progress interactively.

sleap.nn.paf_grouping

This module provides a set of utilities for grouping peaks based on PAFs.

sleap.nn.peak_finding

This module contains TensorFlow-based peak finding methods.

sleap.nn.system

Utilities for working with the physical system (e.g., GPUs).

sleap.nn.tracking

Tracking tools for linking grouped instances over time.

sleap.nn.training

Training functionality and high level APIs.

sleap.nn.utils

This module contains generic utilities used for training and inference.

sleap.nn.viz

Visualization and plotting utilities.

sleap.nn.architectures.common

Common utilities for architecture and model building.

sleap.nn.architectures.encoder_decoder

Generic encoder-decoder fully convolutional backbones.

sleap.nn.architectures.hourglass

This module provides a generalized implementation of (stacked) hourglass.

sleap.nn.architectures.hrnet

(Higher)HRNet backbone.

sleap.nn.architectures.leap

This module provides a generalized implementation of the LEAP CNN.

sleap.nn.architectures.resnet

ResNet-based backbones.

sleap.nn.architectures.unet

This module provides a generalized implementation of UNet.

sleap.nn.architectures.upsampling

This module defines common upsampling layer stack configurations.

sleap.nn.config.data

sleap.nn.config.model

sleap.nn.config.optimization

sleap.nn.config.outputs

sleap.nn.config.training_job

Serializable configuration classes for specifying all training job parameters.

sleap.nn.config.utils

Utilities for config building and validation.

sleap.nn.data.augmentation

Transformers for applying data augmentation.

sleap.nn.data.confidence_maps

Transformers for confidence map generation.

sleap.nn.data.dataset_ops

Transformers for dataset (multi-example) operations, e.g., shuffling and batching.

sleap.nn.data.edge_maps

Transformers for generating edge confidence maps and part affinity fields.

sleap.nn.data.general

General purpose transformers for common pipeline processing tasks.

sleap.nn.data.grouping

Group inference results (“examples”) by frame.

sleap.nn.data.inference

Transformers for performing inference.

sleap.nn.data.instance_centroids

Transformers for finding instance centroids.

sleap.nn.data.instance_cropping

Transformers for cropping instances for topdown processing.

sleap.nn.data.normalization

Transformers for normalizing data formats.

sleap.nn.data.pipelines

This module defines high level pipeline configurations from providers/transformers.

sleap.nn.data.providers

Data providers for pipeline I/O.

sleap.nn.data.resizing

Transformers for image resizing and padding.

sleap.nn.data.training

Transformers and utilities for training-related operations.

sleap.nn.data.utils

Miscellaneous utility functions for data processing.

sleap.nn.tracker.components

Functions/classes used by multiple trackers.

sleap.nn.tracker.kalman

Module to use Kalman filters for tracking instance identities.