A streamlined computer vision project comparing state-of-the-art object detection and tracking models for vehicle speed estimation.
- 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
pip install -r requirements.txt# For demo video (supervision VEHICLES asset)
python homography.py --demo
# For dataset videos (interactive calibration)
python homography.py --dataset MercedesAMG550python main.py demo --detector yolo --tracker bytetrackpython main.py benchmarkspeed-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
Edit config/config.yaml to customize:
- Model parameters
- Device preferences
- Speed limits
- Output paths
- Logging levels
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
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
MIT License - see LICENSE file for details.