How nishantrajora/traffic-violation-detection-deep-learning works
This repository is a helmet-safety computer-vision project with a FastAPI dashboard for image/video detection, model selection, and visualized safe/violation results. Its documented workflow prepares VOC annotations as YOLO data, trains a detector, evaluates it, then serves detections through the dashboard. The graph also shows the separate model-comparison utility and stored checkpoints. The README documents notebook capabilities and workflow; implementation details for those notebooks and portions of the dashboard are not shown in the excerpts.
Main entry points: app.py Detection dashboard · train_model.ipynb Model training · best.pt Custom checkpoint · compre.py Checkpoint comparison
Components 17
Dataset preparation
- VOC source data
- Dataset splitting
split_data.ipynb - YOLO dataset
Model development
- Model training
train_model.ipynb - Custom checkpoint
saved_models/best.pt - Alternate checkpoint
saved_models/helmet_detection_model.pt - Training artifacts
runs/detect/train
Detection dashboard
- Detection dashboard
app.py - Helmet detection
app.py - Safety classification
app.py - Visual results and alerts
app.py - Model selection
app.py - Sample image gallery
app.py
Evaluation
- Model evaluation
test_model.ipynb - Checkpoint comparison
compre.py - Validation artifacts
runs/detect/val
Other components
- User / video source
Connections 18
- VOC source data → Dataset splitting: converts and splits
README.md - Dataset splitting → YOLO dataset: produces YOLO data
README.md - YOLO dataset → Model training: trains on
README.md - Model training → Custom checkpoint: saves checkpoint
README.md - Model training → Training artifacts: records results
README.md - User / video source → Detection dashboard: submits media
README.md - Detection dashboard → Helmet detection: runs detection
app.py - Helmet detection → Safety classification: classifies detections
app.py - Safety classification → Visual results and alerts: annotates results
app.py - Detection dashboard → Model selection: selects model
app.py - Model selection → Custom checkpoint: loads checkpoint
app.py - Model selection → Alternate checkpoint: loads checkpoint
README.md - Detection dashboard → Sample image gallery: serves samples
app.py - YOLO dataset → Model evaluation: evaluates split
README.md - Model evaluation → Validation artifacts: records evaluation
README.md - Custom checkpoint → Checkpoint comparison: compares model
compre.py - Alternate checkpoint → Checkpoint comparison: compares model
compre.py - YOLO dataset → Checkpoint comparison: reads test labels
compre.py