MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut

github.com/DeepLabCut/DeepLabCut @v3.0.0 sqlite

repository ↗ · DeepWiki ↗ · release v3.0.0 ↗
3,419 symbols 12,531 edges 438 files 1,255 documented · 37%
README

📚Documentation | 🛠️ Installation | 🌎 Home Page | 🐿🐴🐁🐘🐆 Model Zoo | 🚨 News | 🪲 Reporting Issues

🫶 Getting Assistance | ∞ DeepLabCut Online Course | 📝 Publications | 👩🏾‍💻👨‍💻 DeepLabCut AI Residency

Version Downloads Downloads PyPI version License: LGPL v3 Code style: black GitHub stars Average time to resolve an issue Percentage of issues still open Image.sc forum Gitter Twitter Follow Generic badge CZI's Essential Open Source Software for Science

Welcome! 👋

DeepLabCut™️ is a toolbox for state-of-the-art markerless pose estimation of animals performing various behaviors. As long as you can see (label) what you want to track, you can use this toolbox, as it is animal and object agnostic. Read a short development and application summary below.

Installation: how to install DeepLabCut

Please click the link above for all the information you need to get started! Please note that currently we support only Python 3.10+ (see conda files for guidance).

Quick start

Developers Stable Release: very quick start (Python 3.10+ required) to install DeepLabCut with the PyTorch engine

  • [1] Install PyTorch (install and then select the desired CUDA version if you want to use a GPU): pip install torch torchvision. Or as an example for GPU support (please check pytorch docs to get the perfect version for your CUDA):
conda install pytorch cudatoolkit=11.3 -c pytorch
  • [2] Then, install DeepLabCut (with all functions + the GUI):
pip install --pre  "deeplabcut[gui]"

or pip install --pre "deeplabcut" (headless version with PyTorch)!

To use the TensorFlow (TF) engine (requires Python 3.10; TF up to v2.10 supported on Windows, up to v2.12 on other platforms): you'll need to run pip install "deeplabcut[gui,tf]" (which includes all functions plus GUIs) or pip install "deeplabcut[tf]" (headless version with PyTorch and TensorFlow). We aim to depreciate the TF part in 2027.

We recommend using our conda file, see here or the deeplabcut-docker package.

Documentation: The DeepLabCut Process

Our docs walk you through using DeepLabCut, and key API points. For an overview of the toolbox and workflow for project management, see our step-by-step at Nature Protocols paper.

For a deeper understanding and more resources for you to get started with Python and DeepLabCut, please check out our free online course! https://deeplabcut.github.io/DeepLabCut/docs/course.html

DEMO the code

🐭 pose tracking of single animals demo Open in Colab

See more demos here. We provide data and several Jupyter Notebooks: one that walks you through a demo dataset to test your installation, and another Notebook to run DeepLabCut from the beginning on your own data. We also show you how to use the code in Docker, and on Google Colab.

Why use DeepLabCut?

DeepLabCut continues to be actively maintained and we strive to provide a user-friendly GUI and API for computer vision researchers and life scientists alike. This means we integrate state-of-the-art models and frameworks, while providing our "best-guess" defaults for life scientists. We highly encourage you to read our papers to get a better understanding of what to use and how to modify the models for your setting.

Performance 🔥

In general, we provide all the tooling for you to train and use custom models with various high-performance backbones. We also provide two foundation pretrained animal models: SuperAnimal-Quadruped, SuperAnimal-TopViewMouse. To gauge their out-of-distribution performance, we provide the following tables.

These models are trained on the SuperAnimal-Quadruped with AP-10K held out for out-of-domain testing and the SuperAnimal-TopViewMouse with DLC-openfield held out for out-of-distribution testing. We provide models that include AP-10K in the API (and GUI). Note, there are many different models to select from in DeepLabCut 3.0. We strongly recommend you check this Guide for more details. This table, and those below, give you a sense of performance in real-world complex in-the-wild and lab mouse data, respectively. This link provides the model weights to reproduce the numbers; but please note, our full models are in our DLClibrary and released in the API.

DLC 3.0 Pose Estimation (Top Down Models)

Model Name Type mAP SA-Q on AP-10K mAP SA-TVM on DLC-OpenField
top_down_resnet_50 Top-Down 54.9 93.5
top_down_resnet_101 Top-Down 55.9 94.1
top_down_hrnet_w32 Top-Down 52.5 92.4
top_down_hrnet_w48 Top-Down 55.3 93.8
rtmpose_s Top-Down 52.9 92.9
rtmpose_m Top-Down 55.4 94.8
rtmpose_x Top-Down 57.6 94.5

The History

In 2018, we demonstrated the capabilities for trail tracking, reaching in mice and various Drosophila behaviors during egg-laying (see Mathis et al. for details). There is, however, nothing specific that makes the toolbox only applicable to these tasks and/or species. The toolbox has already been successfully applied (by us and others) to rats, humans, various fish species, bacteria, leeches, various robots, cheetahs, mouse whiskers and race horses. DeepLabCut utilized the feature detectors (ResNets + readout layers) of one of the state-of-the-art algorithms for human pose estimation by Insafutdinov et al., called DeeperCut, which inspired the name for our toolbox (see references below). Since this time, the package has changed substantially. The code has been re-tooled and re-factored since 2.1+: We have added faster and higher performance variants with MobileNetV2s, EfficientNets, and our own DLCRNet backbones (see Pretraining boosts out-of-domain robustness for pose estimation and Lauer et al 2022). Additionally, we have improved the inference speed and provided both additional and novel augmentation methods, added real-time, and multi-animal support. In v3.0+ we have changed the backend to support PyTorch. This brings not only an easier installation process for users, but performance gains, developer flexibility, and a lot of new tools! Importantly, the high-level API stays the same, so it will be a seamless transition for users 💜! We currently provide state-of-the-art performance for animal pose estimation and the labs (M. Mathis Lab and A. Mathis Group) have both top journal and computer vision conference papers.

Left: Due to transfer learning it requires little training data for multiple, challenging behaviors (see Mathis et al. 2018 for details). Mid Left: The feature detectors are robust to video compression (see Mathis/Warren for details). Mid Right: It allows 3D pose estimation with a single network and camera (see Mathis/Warren). Right: It allows 3D pose estimation with a single network trained on data from multiple cameras together with standard triangulation methods (see Nath and Mathis et al. 2019).

DeepLabCut is embedding in a larger open-source eco-system, providing behavioral tracking for neuroscience, ecology, medical, and technical applications. Moreover, many new tools are being act

Core symbols most depended-on inside this repo

get
called by 577
deeplabcut/pose_estimation_pytorch/registry.py
items
called by 234
deeplabcut/gui/widgets.py
connect
called by 209
deeplabcut/gui/tracklet_toolbox.py
keys
called by 111
deeplabcut/pose_estimation_pytorch/runners/shelving.py
load
called by 100
deeplabcut/generate_training_dataset/metadata.py
add
called by 99
deeplabcut/benchmark/base.py
split
called by 97
deeplabcut/utils/auxfun_videos.py
read_config
called by 90
deeplabcut/gui/widgets.py

Shape

Method 1,573
Function 1,456
Class 360
Route 30

Languages

Python100%

Modules by API surface

deeplabcut/refine_training_dataset/stitch.py72 symbols
deeplabcut/gui/widgets.py72 symbols
deeplabcut/gui/tracklet_toolbox.py60 symbols
deeplabcut/core/inferenceutils.py56 symbols
deeplabcut/gui/window.py55 symbols
deeplabcut/gui/components.py54 symbols
deeplabcut/core/trackingutils.py54 symbols
deeplabcut/utils/auxfun_videos.py47 symbols
deeplabcut/pose_estimation_pytorch/runners/inference.py47 symbols
tools/docs_and_notebooks_check.py46 symbols
deeplabcut/utils/auxiliaryfunctions.py44 symbols
deeplabcut/pose_estimation_pytorch/data/transforms.py44 symbols

Dependencies from manifests, versioned

albumentations1.4.3 · 1×
dlclibrary0.0.12 · 1×
filterpy1.4.4 · 1×
huggingface-hub0.23 · 1×
imageio-ffmpeg
imgaug0.4 · 1×
networkx2.6 · 1×
numba0.54 · 1×
packaging26 · 1×

For agents

$ claude mcp add DeepLabCut \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact