Skip to main content

A unified library for object tracking featuring clean room re-implementations of leading multi-object tracking algorithms

Project description

trackers logo

trackers

Plug-and-play multi-object tracking for any detection model.

version downloads license python-version hf space colab discord

Try It

No install needed. Try trackers in your browser with our Hugging Face Playground.

Install

pip install trackers
install from source
pip install git+https://github.com/roboflow/trackers.git

https://github.com/user-attachments/assets/eef9b00a-cfe4-40f7-a495-954550e3ef1f

Track from CLI

Point at a video, webcam, RTSP stream, or image directory. Get tracked output.

Use our interactive command builder to configure your tracking pipeline.

trackers track \
    --source video.mp4 \
    --output output.mp4 \
    --model rfdetr-medium \
    --tracker bytetrack \
    --show-labels \
    --show-trajectories

Track from Python

Plug trackers into your existing detection pipeline. Works with any detector.

import cv2
import supervision as sv
from inference import get_model
from trackers import ByteTrackTracker

model = get_model(model_id="rfdetr-medium")
tracker = ByteTrackTracker()

label_annotator = sv.LabelAnnotator()
trajectory_annotator = sv.TrajectoryAnnotator()

cap = cv2.VideoCapture("video.mp4")
while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        break

    result = model.infer(frame)[0]
    detections = sv.Detections.from_inference(result)
    tracked = tracker.update(detections)

    frame = label_annotator.annotate(frame, tracked)
    frame = trajectory_annotator.annotate(frame, tracked)

Evaluate

Benchmark your tracker against ground truth with standard MOT metrics.

trackers eval \
    --gt-dir data/gt \
    --tracker-dir data/trackers \
    --metrics CLEAR HOTA Identity
Sequence                        MOTA    HOTA    IDF1  IDSW
----------------------------------------------------------
MOT17-02-FRCNN                75.600  62.300  72.100    42
MOT17-04-FRCNN                78.200  65.100  74.800    31
----------------------------------------------------------
COMBINED                      75.033  62.400  72.033    73

Algorithms

Clean, modular implementations of leading trackers. See the tracker comparison for detailed benchmarks.

Algorithm MOT17 SportsMOT SoccerNet
SORT 58.4 70.9 81.6
ByteTrack 60.1 73.0 84.0
OC-SORT
BoT-SORT
McByte

Contributing

We welcome contributions. Read our contributor guidelines to get started.

License

The code is released under the Apache 2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trackers-2.2.0.tar.gz (329.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trackers-2.2.0-py3-none-any.whl (71.5 kB view details)

Uploaded Python 3

File details

Details for the file trackers-2.2.0.tar.gz.

File metadata

  • Download URL: trackers-2.2.0.tar.gz
  • Upload date:
  • Size: 329.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trackers-2.2.0.tar.gz
Algorithm Hash digest
SHA256 9e5bac506d756b882f27a6785906673d7482376e29715d796a8e70740908e77e
MD5 2a79912dc9256d796d29ac06aed7681c
BLAKE2b-256 b369993225848cea1d4031bb78932900949ddb4e43ae7d23956a66743458c96d

See more details on using hashes here.

Provenance

The following attestation bundles were made for trackers-2.2.0.tar.gz:

Publisher: publish-release.yml on roboflow/trackers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trackers-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: trackers-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 71.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trackers-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3238e2df8574d269fd1a55bd331a99bbeffd899ea16177f424610448e8a5006d
MD5 1bf617db0914e46ba2032820a0afcfda
BLAKE2b-256 5b6c414308868dcfe445e6ca9620b8731d797b9326bf5c2e08e7d8a8ae76056d

See more details on using hashes here.

Provenance

The following attestation bundles were made for trackers-2.2.0-py3-none-any.whl:

Publisher: publish-release.yml on roboflow/trackers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page