Skip to main content

MouseLite

MouseLite

Paper Dataset Zenodo

Real-time mouse detection, segmentation and pose estimation.

MouseLite finds every mouse in a video, keeps its identity from frame to frame, and optionally places keypoints on its body. You get back an annotated video to check by eye, a COCO export, and CSV tables of positions and per-track statistics.

What do you want to do?

You want to… Use What it takes
Analyse videos by drag-and-drop the app, in your browser two lines in a terminal
Batch-analyse a folder of videos the CLI one line in a terminal
Improve results on your own set-up fine-tuning, which can reuse a DeepLabCut project a few hundred labelled frames
Build MouseLite into your own code the Python API Python

If you have never used a terminal, start with the quick start, which walks through every step.

Installation

pip install mouselite                    # or: uv add mouselite
pip install "mouselite[app]"             # with the Gradio demo (includes train)
pip install "mouselite[train]"           # to fine-tune on your own data

Requires Python ≥ 3.11.

Models

Three model kinds, fine-tuned from RF-DETR on the MTMB dataset:

--kind --size Output
detection nano, small, medium, large bounding boxes
segmentation nano, small, medium, large boxes + instance masks
keypoints single checkpoint boxes + pose keypoints

Tracking is handled by trackers.

The app

uvx --from "mouselite[app]" mouselite app     # or: mouselite app

Your browser opens on the app. Drop in a video, choose the Kind and the number of animals (Max animals), click Run, then watch the annotated video and download the results. If two mice swap identities after a contact, pick another Tracker and click Retrack: that takes seconds, because the mice are not detected again.

On a slow computer, an Inference stride of 2 roughly halves the time by analysing one frame out of two.

The CLI

# Run keypoints predictions on 'video.mp4' with maximum 2 animals and bytetrack tracker
mouselite run video.mp4 --kind keypoints --top-k 2 --tracker bytetrack

# Batch analysis: pass a folder to process every video in it
mouselite run /my-folder/ --kind keypoints --top-k 2 --tracker bytetrack

# Re-run tracking without re-running inference 
mouselite retrack output/video_results/video_annotations.json video.mp4 --tracker ocsort --lost-track-buffer 90 --minimum-iou-threshold 0.15

See the docs for all the CLI options.

Fine-tuning

If the released weights fall short on your recordings, fine-tune them on a few hundred labelled frames of your own footage:

mouselite train dataset/ --kind keypoints --epochs 30

dataset/ is a COCO dataset with train/ and valid/ folders. Coming from DeepLabCut or Lightning Pose, point train at the project and add --from; the labelled frames are converted before training starts:

mouselite train dlc-project/ --kind keypoints --from deeplabcut --epochs 30
mouselite train lp-project/ --kind keypoints --from lightning-pose --epochs 30

Then run your videos with the new weights:

mouselite run video.mp4 --kind keypoints --checkpoint output/<timestamp>/checkpoint_best_ema.pth

See Fine-tuning for the options and what the conversion does.

Python API

The CLI is a thin wrapper over three pieces: a model, a tracker, and a Pipeline that joins them.

from mouselite.models import get_model
from mouselite.pipeline import Pipeline
from mouselite.tracker import get_tracker, retrack

pipeline = Pipeline(get_model("keypoints"), get_tracker("bytetrack"), threshold=0.5, top_k=2)
results_dir = pipeline.run("video.mp4", output_dir="output")

retracked_path = retrack(
    "output/video_results/video_annotations.json",
    "video.mp4",
    "bytetrack",
    output_dir="output",
    lost_track_buffer=90,   # any further kwargs go to the tracker class
)

If something goes wrong

  • uvx is not recognised: open a new terminal after installing uv.
  • A video does not play in the browser: the analysis is fine; download it and open it with VLC.
  • Mice are missed, or keypoints land in the wrong place: try a lower --threshold, then fine-tune.
  • Anything else: open an issue with what the terminal shows.

Reproducibility

The code behind the released models — fine-tuning RF-DETR and the DeepLabCut SuperAnimal baseline, plus the scripts that scored them — lives in paper/. It is for reproducing the paper.

Citation

If MouseLite helps your research, please cite the accompanying paper:

@article{Cobos2026.10.02.756254,
  author    = {Cobos, Juan and Thirard, Steeve and Belkaid, Marwen and Naude, Jeremie},
  title     = {A promptable foundation model enables automated multi-task dataset construction and real-time pose estimation in mice},
  journal   = {bioRxiv},
  year      = {2026},
  publisher = {Cold Spring Harbor Laboratory},
  doi       = {10.64898/2026.10.02.756254},
  URL       = {https://www.biorxiv.org/content/10.64898/2026.10.02.756254v1}
}

Acknowledgements

MouseLite is built on work by others:

  • RF-DETR — the real-time detection transformer behind every MouseLite model. The detection, segmentation and keypoints-preview architectures are RF-DETR's; MouseLite fine-tunes them on mice.
  • supervision — detection and keypoint containers, NMS, annotators, video I/O and the COCO format helpers. It is the vocabulary the whole pipeline is written in.
  • trackers — every multi-object tracker MouseLite offers. ByteTrack, BoT-SORT, OC-SORT, SORT, C-BIoU and McByte all come from it unchanged; MouseLite only picks one and hands it detections.
  • DeepLabCut — the reference point for markerless animal pose estimation, and the SuperAnimal baseline MouseLite is evaluated against. This project exists because of the problem DeepLabCut defined and the community it built around it.

Metadata

Release files for mouselite 0.1.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 mouselite 0.1.3
File Size Uploaded Provenance Actions
mouselite-0.1.3.tar.gz 36.5 kB Without provenance Details for mouselite-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mouselite 0.1.3
File Interpreter ABI Platform Actions
mouselite-0.1.3-py3-none-any.whl Python 3 none any Details for mouselite-0.1.3-py3-none-any.whl

Total release size: 80.6 kB

Release files / mouselite-0.1.3.tar.gz

Download URL mouselite-0.1.3.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c4fcd211f0e91062cb50e359dda426270457cbfe6c3220ce4fd998053eb8524f
BLAKE2b-256 checksum
How to use checksums
9870c01ed7d1fa1a0a39db203337e901a12f64d8dcabc66162f36fb38c7db4a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mouselite-0.1.3-py3-none-any.whl

Download URL mouselite-0.1.3-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6a62e568b654e098fb9236ae9b8978e033b2004f4f55b6217e61c0262a94780
BLAKE2b-256 checksum
How to use checksums
0fbab279b9e216e58a11a3521e1864a8f34178994000e8f26bebbe1459e87564
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mouselite 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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