zghias/Multiple-Object-Tracking-with-SORT
Multiple Object Tracking with SORT and DeepSORT
Author: Zuhair Ghias
Email: zuhairg2@illinois.edu
Source code: https://github.com/ZuhairGhias/Multiple-Object-Tracking-with-SORT
Demo: https://huggingface.co/spaces/zghias/Multiple-Object-Tracking-with-SORT
This project is an interactive technical demo for multiple object tracking on MOT17. It compares a progression of tracking-by-detection methods:
- Naive IoU association
- SORT
- DeepSORT
- MyDeepSORT2, a lightweight DeepSORT variant using HSV color histograms and IoU-gated association
The Gradio app includes curated MOT17-09-SDP videos, metric plots, runtime plots, and a written report explaining the methods and tradeoffs.
Demo
Run the app locally:
pip install -r requirements.txt
python app.pyThe app opens at a local Gradio URL. The demo videos are stored under:
data/videos/MOT17-09-SDP/Included videos:
source.mp4detections.mp4tracking_naive_iou.mp4tracking_sort.mp4tracking_deep_sort.mp4tracking_my_deep_sort2.mp4tracking_gt.mp4
Project Structure
Core source code:
src/methods/tracking/SORT.py: SORT implementationsrc/methods/tracking/deep_SORT.py: DeepSORT implementation and shared DeepSORT helperssrc/methods/tracking/MyDeepSORT2.py: lightweight color-histogram DeepSORT variantsrc/metrics/: MOT metric calculation helperssrc/utils/mot17.py: MOT17 video generation utilitysrc/utils/mot17_metrics.py: MOT17 metrics pipelinesrc/utils/mot17_metrics_plots.py: static plot and table generationapp.py: Gradio demo and written report
Generating Demo Videos
The committed demo uses MOT17-09-SDP. To regenerate those videos from a local MOT17 checkout:
python -m src.utils.mot17 MOT17-09-SDP --output-dir data/videosThe video utility writes source, detections, ground truth, Naive IoU, SORT, DeepSORT, and MyDeepSORT2 MP4s. It uses H.264 output when imageio-ffmpeg is installed, which improves browser playback in Gradio.
Generating MOT17 Metrics
The metrics utility scores every locally available MOT17 training sequence under data/MOT17/train that contains:
seqinfo.inidet/det.txtgt/gt.txt
Run:
python -m src.utils.mot17_metricsThe command writes:
data/metrics/MOT17_tracking_metrics.csvThe CSV contains independent sequence rows, detector/tracker aggregate rows, overall aggregate rows, frame counts, prediction counts, runtime fields, and standard MOT metrics such as MOTA, MOTP, IDF1, FP, FN, ID switches, and fragmentations.
Plotting Metrics
Generate the report plots from the saved CSV:
python -m src.utils.mot17_metrics_plotsThe app currently uses the full comparison plots for:
- Naive IoU
- SORT
- DeepSORT
- MyDeepSORT2
The plot filenames follow this convention:
MOT17_tracking_trackers-{trackers}_detectors-{detectors}_{plot_name}.pngYou can generate smaller comparison plots with filters:
python -m src.utils.mot17_metrics_plots --trackers naive_iou,sort
python -m src.utils.mot17_metrics_plots --trackers naive_iou,sort,deep_sort --detectors SDPRelevant Papers
- Bewley et al., "Simple Online and Realtime Tracking", 2016. https://arxiv.org/abs/1602.00763
- Wojke et al., "Simple Online and Realtime Tracking with a Deep Association Metric", 2017. https://arxiv.org/abs/1703.07402
- Du et al., "StrongSORT: Make DeepSORT Great Again", 2022. https://arxiv.org/abs/2202.13514
AI Use Policy
I worked on the core tracker implementations and evaluation logic. I used AI assistance for brainstorming, utility code, automation, the evaluation framework, debugging, cleanup, and generating repeatable plots and videos. I reviewed and integrated the changes myself.
