CoolFace
Modelpublic

abrarhameem398/traffice-detection-best

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes54downloads
Model Card

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).

ClassImagesInstancesPRmAP@50mAP@50-95
All4736528500.7010.7130.7620.528
Bike213531730.7740.7810.8510.510
Bus3895104080.7870.8660.9000.657
Car4281126270.8240.9000.9340.699
Cng312655090.8230.8450.9110.652
People287476470.7990.7640.8630.546
Rickshaw3849119640.8040.8500.9040.623
Truck2182430.4300.4940.4740.375
Mini-Truck97911360.5680.6810.6900.504
Cycle1391430.4970.2310.3300.183
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

PropertyValue
Base architectureYOLOv8n
Layers (fused)73
Parameters3,007,403
GFLOPs8.1
Input size480 × 480 px
PrecisionFP32 (CPU) / FP16 (CUDA)
TrackerByteTrack
FrameworkUltralytics 8.x

Classes

IDClassDescription
0BikeMotorcycle / motorbike
1BusFull-size passenger bus
2CarPassenger car / sedan / SUV
3CngCNG auto-rickshaw (3-wheel, compressed natural gas)
4PeoplePedestrian
5RickshawHuman-powered cycle rickshaw
6TruckGoods truck / lorry
7Mini-TruckSmall covered van / pickup
8CycleBicycle

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

python
from ultralytics import YOLO

model = YOLO("best.pt")
results = model("traffic.mp4", imgsz=480, conf=0.3)

With ByteTrack (counting + speed)

python
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:

bibtex
@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}
}