opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Plug-and-play multi-object tracking for any detection model, in Python
GitHub RepoImpressions2

Project Description

View on GitHub

Stop Rewriting Tracking Logic: A Python Library That Plugs Into Any Detection Model

You've got a detector that draws boxes around people, cars, or soccer balls just fine. But the moment you need to know that this box in frame 12 is the same object as that box in frame 11, things get complicated. Occlusions, fast motion, a camera that won't sit still—suddenly you're knee-deep in Kalman filters and Hungarian assignment. trackers is a Python library that hands you the tracking part, pre-built and benchmarked, so you can get back to whatever you were actually trying to do.

What It Does

trackers is a multi-object tracking library for Python that provides clean-room, benchmarked implementations of several well-known algorithms: SORT, ByteTrack, OC-SORT, BoT-SORT, C-BIoU, and McByte. Every algorithm is re-implemented from its original paper rather than vendored or wrapped, which means the source is something you can actually read, understand, and modify.

The library is detector-agnostic by design. It works with YOLO, DETR, RT-DETR, or any model that produces bounding boxes—no inference library is required or assumed. It speaks supervision.Detections natively, so it slots directly into the supervision ecosystem: pass detections in, get tracked detections back, no glue code. Every tracker shares the same update(detections, frame=None) interface, so switching from one algorithm to another is a one-line change. It requires Python 3.10 or later.

Why It's Cool

  • Clean-room implementations, not wrappers. This matters more than it sounds. When a tracking library is a thin wrapper around someone else's code, debugging a weird ID switch means spelunking through a dependency you didn't write. Here, every algorithm is re-implemented from the paper, so the code is legible and yours to modify.

  • Apache 2.0, no copyleft. If you're shipping inside a closed-source product, this is the difference between "yes" and "let me talk to legal." The README calls out AGPL-3.0 alternatives like BoxMOT directly—and that's a real practical concern for anyone building commercially.

  • Benchmarked across four datasets. MOT17, SportsMOT, SoccerNet, and DanceTrack—measured at default parameters and after hyperparameter tuning (McByte stays at defaults only, by design). That's the kind of thing you usually have to figure out yourself through trial and error. Here, you know roughly what to expect before you deploy.

  • Camera motion compensation where it counts. BoT-SORT and McByte handle moving cameras natively, keeping track IDs stable even when the whole frame shifts. If you've ever watched IDs scramble because a drone tilted slightly, you'll appreciate this.

  • Tunable with one extra. There's an Optuna-based hyperparameter search available via trackers tune (install with pip install "trackers[tune]"), so you can optimize for your specific scene and detector rather than accepting whatever defaults the original paper used.

  • One interface, three audiences. A researcher comparing algorithms, an engineer shipping a pipeline, and a hobbyist building something for fun all get the same API. That's harder to pull off than it looks.

How to Try It

  1. Install the package. The base install is a single command:

    pip install trackers
    

    If you'd rather install from source:

    pip install git+https://github.com/roboflow/trackers.git
    
  2. Add a detector if you don't have one. The base install doesn't include an inference library. The README's example uses the inference package (pip install inference), but you can swap in any detector that returns supervision.Detections.

  3. Drop tracking into your existing loop. The pattern looks roughly like this—create a tracker, then call update() on each frame's detections:

    import cv2
    import supervision as sv
    from inference import get_model
    from trackers import ByteTrackTracker
    
    model = get_model(model_id="rfdetr-medium")
    tracker = ByteTrackTracker()
    
    cap = cv2.VideoCapture("video.mp4")
    while cap.isOpened():
        ret, frame = cap.read()
        # ... run detection, then:
        # tracked = tracker.update(detections, frame=frame)
    
  4. Swap algorithms by changing one line. Want to try OC-SORT instead? Replace ByteTrackTracker() with the corresponding class. Same interface, same call site.

  5. Read the docs and the repo. There's an install guide at trackers.roboflow.com, a Hugging Face Playground you can poke at without installing anything, and the source itself at github.com/roboflow/trackers.

Final Thoughts

trackers isn't trying to be the only tracking library you'll ever need—it's trying to be the one that doesn't get in your way. The Apache 2.0 license, the detector-agnostic design, and the clean-room implementations make it a solid default for anyone who needs multi-object tracking without signing up for a research project. If you're already in the supervision ecosystem, the fit is close to frictionless. If you're not, the supervision.Detections requirement is the one thing worth checking before you commit. Either way, it's a well-scoped tool that solves a specific, annoying problem—and those tend to age well.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 6f61eca0-8b95-406a-8ad7-a5e50b3fe303Last updated: September 23, 2026 at 02:47 AM