Skip to content

Repository files navigation

VisionTracker: YOLOv11l + Multi-Object Tracking Benchmark

🎯 Objective:
This project benchmarks three Multi-Object Tracking (MOT) algorithms — SORT, DeepSORT, and OCSORT — using YOLOv11m for object detection on CCTV footage. The goal is to analyze tracker behavior, compare ID stability, and empirically study failure modes in real-world CCTV footage.


🚀 Algorithms Implemented

TrackerDescriptionPerformance Observed
SORTSimple Online and Realtime Tracking. Uses Kalman filter + Hungarian method.Fast, but IDs are unstable, frequent ID switches.
DeepSORTSORT + appearance embedding (ReID) for more stable IDs.More stable than SORT, still struggles with occlusions.
OCSORTAdvanced online tracker combining motion + appearance heuristics.Best among the three, smoother trajectories, fewer ID switches, but not perfect.

🎥 Dataset

  • CCTV footage from MART counter (publicly available on YouTube):
    CCTV Footage
  • Duration: ~47 seconds (~1195 frames).
  • Objects of interest: primarily people.

Note: Instead of uploading the video, download it manually from YouTube using tools like yt-dlp or youtube-dl and save it locally in the video/ folder.

Example command using yt-dlp:

mkdir -p video
yt-dlp -o "video/CCTV.mp4" https://youtube.com/watch?v=j0xRvqJ67Ug&si=0lUGDR4hOxoJotMb

🧠 Model Weights

YOLOv11l pre-trained weights are required. You can download official YOLOv11l weights from the Ultralytics repository or train your own. Save the .pt file in a sota/ folder, e.g., sota/yolov11l.pt. Example: Download pretrained weights:

mkdir -p sota
wget -O sota/yolov11l.pt "https://github.com/ultralytics/ultralytics/releases/download/v0.0.0/yolov11l.pt"

🧮 Empirical Tracker Behavior Analysis (Annotation-Free)

Since the dataset lacks annotations, proxy metrics were computed:

MetricDescriptionKey Insight
Average / Median Track LengthDuration of continuous object IDsOCSORT maintained the longest stable tracks
Active Tracks per FrameNumber of ongoing object IDsDeepSORT and OCSORT balanced detection recall
ID Switch CountHow often IDs are reassignedSORT had the highest switch rate
Trajectory SmoothnessBounding box volatilityOCSORT produced the smoothest motion paths

Conclusion: OCSORT consistently outperformed in ID persistence and smoothness across frames.


📊 Visualizations

Metric Visualizations

  • Track length distribution per tracker
  • Active tracks per frame
  • Sample trajectories
  • Combined plots comparing all three trackers

Tracker-Specific Plots

DeepSORTOCSORTSORT
DeepSORT PlotsOCSORT PlotsSORT Plots
DeepSORTOCSORTSORT
DeepSORT Track LengthOCSORT Track LengthSORT Track Length
DeepSORTOCSORTSORT
DeepSORT TrajectoriesOCSORT TrajectoriesSORT Trajectories

Combined Tracker Plots

These plots show all three trackers (SORT, DeepSORT, OCSORT) together for easier comparison:

Track LengthActive TracksTrajectories
Track Length AllActive Tracks AllTrajectories All

All visualizations are saved automatically and can be used to compare tracker behavior.


🖼️ Sample Tracker Outputs

Below are qualitative comparisons across SORT, DeepSORT, and OCSORT at three representative frames in the video sequence
(early, mid, and late — Frames 119, 569, and 1075).

Frame 119

SORTDeepSORTOCSORT
SORTDeepSORTOCSORT

Frame 597

SORTDeepSORTOCSORT
SORTDeepSORTOCSORT

Frame 1075

SORTDeepSORTOCSORT
SORTDeepSORTOCSORT

Observation:

  • SORT tends to switch IDs frequently between frames.
  • DeepSORT improves stability but drifts slightly under occlusion.
  • OCSORT maintains smoother and more persistent tracks over time.


🎬 Tracked Videos

DeepSORTOCSORTSORT
DeepSORTOCSORTSORT

⚙️ How to Run

  1. Install dependencies:
pip install ultralytics opencv-python tqdm seaborn matplotlib deep_sort_realtime
  1. Download the CCTV footage from YouTube or place your video locally.
  2. Run the notebook VisionTracker.ipynb to generate tracked videos and plots.
  3. All outputs (videos, logs, plots) will be saved automatically.

📝 Limitations

  1. ID consistency is not perfect, especially for SORT and partially for DeepSORT.
  2. OCSORT performs best but still suffers from ID switches in crowded scenes or occlusions.
  3. Dataset is short; results may vary with longer or more complex videos.

🔮 Future Work / Learning Goals

  1. Tune OCSORT hyperparameters (detection threshold, max_age, min_hits) for better ID persistence.
  2. Integrate lightweight appearance embeddings for even more stable IDs.
  3. Explore longer sequences and more challenging environments.
  4. Experiment with additional MOT algorithms (ByteTrack, FairMOT, etc.).

📚 Takeaways

  1. Tracker choice significantly impacts ID persistence even with identical detections.
  2. Appearance embeddings improve stability but do not fully solve occlusion-induced ID switches.
  3. OCSORT provides the best trade-off between smooth trajectories and ID consistency in short CCTV sequences.
  4. Proxy metrics and qualitative analysis are viable when labeled MOT datasets are unavailable.
  5. Learning how to debug, visualize, and analyze tracking performance.
  6. Practicing GitHub workflow: sharing, documenting, and versioning work.

🧠 Author

Y.R.A.V.R -- Hyderabad, India


📎 References

About

VisionTracker benchmarks multi-object tracking using YOLOv11l with SORT, DeepSORT, and OCSORT. It provides heuristic metrics like track lifetime, ID switches, bounding box volatility, and trajectory analysis, generating tracked videos, logs, and plots, all without ground-truth annotations.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages