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
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/train/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)
annotated_path = 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.2

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.2
File Size Uploaded
mouselite-0.1.2.tar.gz 28.5 kB Details

Built distribution (wheel)

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

Total release size: 64.2 kB

Release files / mouselite-0.1.2.tar.gz

Download URL mouselite-0.1.2.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b5a1e993bad22c7856b77c5547d7402a4884af97b5bbb22ccdba62f5723371f4
BLAKE2b-256 checksum
How to use checksums
06a2067f5bbd609d08d64291248115901107605639249b3bb9d2452178699087
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.2-py3-none-any.whl

Download URL mouselite-0.1.2-py3-none-any.whl
Size 35.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ed0078f412aa20872f98d06645337245a13040213c2185050d9694f01e30ff8
BLAKE2b-256 checksum
How to use checksums
ed5617d440a72a5fb3b35a1ccb8a5766083c764ee304457d6f76a891ee306d89
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 history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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