Skip to main content

sleap-nn

CI codecov Release PyPI PyPI - Python Version

Neural network backend for training and inference for animal pose estimation.

This is the deep learning engine that powers SLEAP (Social LEAP Estimates Animal Poses), providing neural network architectures for multi-instance animal pose estimation and tracking. Built on PyTorch, SLEAP-NN offers an end-to-end training workflow, supporting multiple model types (Single Instance, Top-Down, Bottom-Up, Multi-Class), and seamless integration with SLEAP's GUI and command-line tools.

Need a quick start? Refer to our Quick Start guide in the docs.

Documentation

Documentation - Comprehensive guides and API reference

For development setup

  1. Clone the sleap-nn repo
git clone https://github.com/talmolab/sleap-nn.git
cd sleap-nn
  1. Install uv Install uv first - a fast Python package manager:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. Install sleap-nn dependencies based on your platform\

Python 3.14 is not yet supported

sleap-nn currently supports Python 3.11, 3.12, and 3.13. Python 3.14 is not yet tested or supported. By default, uv will use your system-installed Python. If you have Python 3.14 installed, you must specify the Python version (≤3.13) in the install command.

For example:

uv sync --python 3.13 ...

Replace ... with the rest of your install command as needed.

  • Install everything with a single command. uv sync creates a .venv (virtual environment) inside your current working directory. This environment is only active within that directory and can't be directly accessed from outside. To use installed packages, run commands with uv run (e.g., uv run sleap-nn train ... or uv run pytest ...).

    uv sync
    

    This installs the CUDA 13.0 GPU build on Windows/Linux (x86-64) and the Apple-MPS build on macOS automatically, and uv run keeps it. A GPU is not required — the CUDA wheel also runs on CPU.

    Want the smaller CPU-only wheel (CPU-only machines/CI, Linux aarch64) or a specific CUDA version? Add --no-group gpu, e.g. uv sync --no-group gpu --extra cpu or uv sync --no-group gpu --extra torch-cuda128.

  1. Run tests

    uv run pytest tests
    
  2. (Optional) Lint and format code

    uv run black --check sleap_nn tests
    uv run ruff check sleap_nn/
    

Upgrading All Dependencies To ensure you have the latest versions of all dependencies, use the --upgrade flag with uv sync:

uv sync --upgrade

This will upgrade all installed packages in your environment to the latest available versions compatible with your pyproject.toml.

Metadata

Release files for sleap-nn 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sleap-nn 0.3.3
File Size Uploaded
sleap_nn-0.3.3.tar.gz 27.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sleap-nn 0.3.3
File Interpreter ABI Platform
sleap_nn-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 27.7 MB

Release files / sleap_nn-0.3.3.tar.gz

Download URL sleap_nn-0.3.3.tar.gz
Size 27.0 MB
Tags Source
SHA-256 checksum
How to use checksums
d7437d72bef80d0540b60bfabd3558d888cefcc3aecfb6335978069c32784d2d
BLAKE2b-256 checksum
How to use checksums
5d74432b2eed0fb46f4a76db9cb703a217edf1ce570b82a60b178b4e585e9f63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / sleap_nn-0.3.3-py3-none-any.whl

Download URL sleap_nn-0.3.3-py3-none-any.whl
Size 783.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d422405b4c239bf43782b6b046501de7935806cce82d31e6b500a256fbf36e0a
BLAKE2b-256 checksum
How to use checksums
b7049b3c080d9ee27ac4725fad6dd73c5a238dc3be17ccdac1ac96b3246f21a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page