Skip to content

Vehicle detection, tracking, and speed estimation with 3 SOTA detection and tracking models for benchmarking and demo video comparison.

License

Notifications You must be signed in to change notification settings

mardelpozo/speed-track

Repository files navigation

Speed Tracking SOTA Model Performance Comparison

A streamlined computer vision project comparing state-of-the-art object detection and tracking models for vehicle speed estimation.

Features

  • 3 Detection Models: YOLO, RetinaNet, RF-DETR
  • 2 Tracking Algorithms: ByteTrack, Norfair
  • Comprehensive Metrics: Speed accuracy, overspeeding alerts, tracking performance
  • Cross-platform: Auto-detects best device (MPS, CUDA, CPU)
  • Real Calculations: Homography-based speed estimation for accurate results

Quick Start

Installation

pip install -r requirements.txt

Setup Calibration

# For demo video (supervision VEHICLES asset)
python homography.py --demo

# For dataset videos (interactive calibration)
python homography.py --dataset MercedesAMG550

Run Demo

python main.py demo --detector yolo --tracker bytetrack

Run Benchmark

python main.py benchmark

Project Structure

speed-track/
├── main.py              # CLI entrypoint
├── benchmark.py         # Model evaluation
├── demo.py             # Demo video processing  
├── homography.py       # Calibration utilities
├── config/
│   ├── config.yaml     # Centralized configuration
│   └── config.py       # Config loading utilities
├── utils/
│   ├── factory.py      # Model/tracker creation
│   ├── evaluation.py   # Performance evaluation
│   ├── speed.py        # Speed calculation
│   └── visualization.py # Video annotation
├── models/             # Detection models
├── trackers/           # Tracking algorithms
└── data/              # Dataset and calibration files

Configuration

Edit config/config.yaml to customize:

  • Model parameters
  • Device preferences
  • Speed limits
  • Output paths
  • Logging levels

Metrics

The benchmark evaluates:

Speed Estimation:

  • MAE, RMSE, Bias

Overspeeding Detection:

  • Accuracy, Precision, Recall, F1, FPR

Tracking Performance:

  • Duration, Coverage

System Performance:

  • Inference Speed, Computational Load

Dataset

Uses VS13 MercedesAMG550 subset with:

  • MP4 videos of single vehicle passes
  • TXT annotations with ground truth speed and timestamp
  • Requires manual homography calibration per video

License

MIT License - see LICENSE file for details.

About

Vehicle detection, tracking, and speed estimation with 3 SOTA detection and tracking models for benchmarking and demo video comparison.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published