Open source · Apache 2.0 · Published in eLife

Fast and robust animal pose estimation, in a few lines of Python.

DeepPoseKit is a high-level toolkit for 2D pose estimation of user-defined keypoints using deep learning. It bundles efficient multi-scale models, GPU peak detection, an annotation tool, and a Keras-friendly training API.

>2×
faster than prior tools
Subpixel
keypoint precision
TF ≥ 1.13
TensorFlow + Keras
pip
Python install
install.sh
# Install the stable release
pip install --update deepposekit

# Or the bleeding-edge build
pip install --update \
  git+https://github.com/jgraving/deepposekit.git
Why DeepPoseKit

Built for behavioural science workflows.

DeepPoseKit pairs a novel multi-scale model with a GPU peak-detection algorithm, addressing the speed and robustness limitations of prior animal pose-estimation tools — all behind a small, ergonomic Python API.

Stacked DenseNet

A new multi-scale architecture that delivers >2× faster inference than prior tools with no loss in keypoint accuracy.

Subpixel peak detection

GPU-accelerated peak detection extracts keypoint locations with subpixel precision directly from the confidence maps.

Easy data annotation

Annotate user-defined keypoints on images or video frames with the built-in interactive annotation tool.

imgaug-powered augmentation

A flexible augmentation pipeline using imgaug, designed to mirror the variability you'll see at inference time.

Keras-style API

Initialise, train, evaluate, save and load models with the same idioms you already use in TensorFlow / Keras.

Lab and field ready

Validated on multiple challenging animal datasets — including interacting groups of individuals in the wild.

Quickstart

Train and run a model in a handful of lines.

Point a DataGenerator at your annotation HDF5 file, wrap it with TrainingGenerator, pick a backbone, and call model.fit(). The full workflow lives in the docs.

Open the quickstart
train.py
from deepposekit.io import DataGenerator, TrainingGenerator
from deepposekit.models import StackedDenseNet

data_generator = DataGenerator('/path/to/annotation_data.h5')
train_generator = TrainingGenerator(data_generator)

model = StackedDenseNet(train_generator)
model.fit(batch_size=16, n_workers=8)
model.save('/path/to/saved_model.h5')
predict.py
from deepposekit.models import load_model
from deepposekit.io import VideoReader

model = load_model('/path/to/saved_model.h5')
reader = VideoReader('/path/to/video.mp4')

predictions = model.predict(reader)
Research

Backed by a peer-reviewed paper in eLife.

DeepPoseKit, a software toolkit for fast and robust animal pose estimation using deep learning — Graving, Chae, Naik, Li, Koger, Costelloe & Couzin. eLife 8:e47994 (2019).

Cite DeepPoseKit
Please cite the eLife article if you use DeepPoseKit in your research.
@article{graving2019deepposekit,
    title={DeepPoseKit, a software toolkit for fast and robust animal pose estimation using deep learning},
    author={Graving, Jacob M and Chae, Daniel and Naik, Hemal and Li, Liang and Koger, Benjamin and Costelloe, Blair R and Couzin, Iain D},
    journal={eLife},
    volume={8},
    pages={e47994},
    year={2019},
    publisher={eLife Sciences Publications Limited},
    url={https://doi.org/10.7554/eLife.47994}
}
The DeepPoseKit family

One project, four sites.

Each sibling site is dedicated to a different audience. Pick the one closest to what you’re doing right now.

Documentation
API reference, tutorials and examples.
Published paper
The full eLife article and figures.
Preprint
The bioRxiv preprint, including all versions.