The thankless math behind 'who is tracking whom'
A Python toolkit that implements the gnarly assignment algorithms needed to fairly score multi-object trackers.

What it does
py-motmetrics computes standard MOT (Multiple Object Tracking) benchmarks in Python. You feed it ground-truth objects and tracker hypotheses per frame; it handles the combinatorial mess of matching them up and spits out metrics like MOTA, MOTP, IDF1, and HOTA. It also tracks the full event history—matches, misses, false positives, identity switches—so you can debug why your tracker confuses person #3 with person #7.
The interesting bit
The library doesn’t just slap IoU thresholds together. It implements two genuinely different philosophies: CLEAR-MOT solves the assignment frame-by-frame (local, greedy), while ID-MEASURE does a global minimum-cost matching across all frames. The README even walks through how to convert its MOTP values to match MOTChallenge’s percentage format, which is the kind of pedantic compatibility work that saves hours of head-scratching.
Key highlights
- Implements CLEAR-MOT, ID, and HOTA metrics aligned with MOTChallenge benchmarks
- Distance-agnostic: Euclidean, IoU, or roll your own
- Pluggable solver backends (scipy, ortools, munkres) with auto-selection by problem size
- Built on pandas DataFrames; metrics can reuse computed values from dependencies
- Command-line eval tools for MOTChallenge and MOT16/17 formats
Caveats
- MOTP output uses the original definition (average distance), not MOTChallenge’s percentage format; manual conversion needed for direct comparison
- Python 3.5/3.6/3.9 support listed; unclear if newer versions are tested
- FAR metric is missing from output (recoverable manually, but still)
Verdict
Grab this if you’re building or benchmarking multi-object trackers and need rigorous, comparable metrics without wrestling with MATLAB. Skip it if you’re doing single-object tracking—this is overkill, and the README basically admits that.