ID 01 · 2026 · MOT17-09
Real-Time Multi-Object Tracking Pipeline (MOT17)
I built a system that finds every person in a video and follows each one from frame to frame, even when they walk past each other. I trained the detector myself, then made it run almost twice as fast on a normal computer without losing any accuracy, so it could work in the real world and not just on a powerful GPU.
View the code on GitHub- Detection mAP@0.5
- 60.6%
- Tracking MOTA
- 52.2%
- CPU speed-up
- 1.84×
ID 02 · tracking
Following people between frames
Spotting a person in one frame is only half the job. The harder part is knowing that the person in this frame is the same person as in the last one. Each colour in the video is one person. When two people cross, the tracker can mix them up, or lose one and give them a new number. This is called an identity switch.
Over the 525 frames of this video my system made about 70 of them. That is the part I would work on next, more than the detection score.
ID 03 · speed
Speed: PyTorch vs ONNX
I wanted the system to be usable on a normal computer, not just on a powerful GPU. Exporting the detector to ONNX made it run 1.84 times faster on a CPU, and the boxes it draws match the original model exactly, so nothing was lost. The two boxes below move at each model's real frame rate.
86.4 ms per frame
47.0 ms per frame
ID 04 · two trackers
Comparing BoT-SORT and ByteTrack
I tested two trackers on the same detections. BoT-SORT adds a step that corrects for camera movement, while ByteTrack is simpler and faster. In this video the camera barely moves, so both scored almost exactly the same.
I only tested them on one video, MOT17-09, so I can't say one is better in general. Before using either in a real product I would test them on many more videos.
| Tracker | MOTA | IDF1 | Switches |
|---|---|---|---|
| BoT-SORT | 52.15% | 47.21% | 71 |
| ByteTrack | 52.21% | 47.20% | 70 |
MOTA counts misses, false alarms and switches together. IDF1 measures how long each identity is held. Higher is better for both.
ID 05 · pipeline
The pipeline
I split the project into six stages, each run with one command. Nothing is hardcoded: every path, setting and threshold comes from a config file, and the whole thing is tested and checked by CI on every change.
01
Prepare
MOT17 ground truth to YOLO labels, with QA checks
02
Train
Fine-tune YOLO26n for 30 epochs
03
Track
BoT-SORT and ByteTrack
04
Export
ONNX, checked for identical output
05
Benchmark
PyTorch against ONNX on a CPU
06
Evaluate
MOTA, IDF1 and a metrics file
ID 06 · engineering
How it is built
- Python
- PyTorch
- Ultralytics YOLO
- BoT-SORT
- ByteTrack
- ONNX
- MLflow
An end-to-end pedestrian detection-and-tracking pipeline covering data curation, training, tracking, deployment optimisation, and benchmarking.
- Dataset and annotation tooling converting MOT17 ground truth to normalised YOLO labels, with automated validation and QA checks
- Fine-tuned YOLO26n for 30 epochs on the full MOT17 train split, then benchmarked BoT-SORT against ByteTrack for the tracking stage
- ONNX export at bit-exact, 0-pixel parity with the PyTorch model
- Fully typed, tested, linted, config-driven, with green CI and MLflow experiment tracking