abrarhameem398/traffice-detection-best
YOLOv8n — Bangladeshi Urban Traffic Detection
A YOLOv8n model fine-tuned on Bangladeshi roadside traffic footage to detect and classify 9 vehicle and pedestrian types common in South Asian urban environments. Designed for real-time inference — 3.4 ms per image on GPU, ~15 FPS end-to-end in the streaming pipeline.
Evaluation Results
Evaluated on 4,736 validation images (52,850 instances).
Note: Truck, Mini-Truck, and Cycle have significantly fewer training instances (143–1136) compared to other classes (3000–12000+), which explains their lower recall and mAP. Performance on these classes will improve with more annotated data.
Inference speed (per image): 0.1ms preprocess · 3.4ms inference · 0.4ms postprocess
Model Details
Classes
Intended Use
- Real-time traffic monitoring from fixed roadside cameras
- Vehicle counting and classification
- Speed estimation with multi-object tracking (ByteTrack)
- Traffic density and flow analysis dashboards
This model is optimised for Bangladeshi and similar South Asian traffic environments where CNGs, rickshaws, and cycle rickshaws are prevalent — classes typically absent from Western traffic datasets.
Limitations
- Trained on Bangladeshi urban roads; performance may degrade on highways or in other countries with different vehicle types
- Truck, Mini-Truck, and Cycle detection is weaker due to limited training data (see evaluation table)
- Speed estimates rely on a fixed pixel-to-metre heuristic (
PX_TO_METER = 0.05) calibrated for a typical roadside camera height — recalibrate for different mounting heights - Low-light and heavily occluded scenes will reduce detection confidence
How to Use
Inference only
from ultralytics import YOLO
model = YOLO("best.pt")
results = model("traffic.mp4", imgsz=480, conf=0.3)With ByteTrack (counting + speed)
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.track(
source="traffic.mp4",
tracker="bytetrack.yaml",
imgsz=480,
conf=0.3,
iou=0.5,
persist=True,
stream=True,
)
for result in results:
print(result.boxes)Full web dashboard
The model powers a real-time FastAPI + WebSocket dashboard with live class filtering, speed estimation, and Chart.js visualisations.
→ abrarCSE29/traffic-detection-yolo
Training
- Base weights:
yolov8n.pt(ImageNet pre-trained) - Dataset: Bangladeshi Traffic Flow Dataset — Islam, Mohammad Manzurul; Rashid, Mohammad Rifat Ahmmad (2024), Mendeley Data, V2, doi:10.17632/h8bfgtdp2r.2
- Validation set: 4,736 images · 52,850 instances across 9 classes
- Framework: Ultralytics YOLOv8
Citation
If you use this model or dataset, please cite:
@misc{abrar_hameem_2026,
author = { Abrar Hameem },
title = { traffice-detection-best (Revision 0567f6e) },
year = 2026,
url = { https://huggingface.co/abrarhameem398/traffice-detection-best },
doi = { 10.57967/hf/8409 },
publisher = { Hugging Face }
}
@misc{bangladeshi-traffic-dataset,
author = {Islam, Mohammad Manzurul; Rashid, Mohammad Rifat Ahmmad },
title = {Bangladeshi Traffic Flow Dataset},
year = {2024},
publisher = {Mendeley Data},
doi = {10.17632/h8bfgtdp2r.2},
url = {https://data.mendeley.com/datasets/h8bfgtdp2r/2}
}