CoolFace
Modelpublic

Madan11/two-wheeler-detector

sourceHugging Faceagpl-3.0updated 1mo agoView on Hugging Face
0likes46downloads
Model Card

Two-Wheeler & Vehicle Detector (YOLOv8n)

A custom-trained YOLOv8n object detection model for detecting vehicles in images and video, with a focus on two-wheelers (motorcycles, scooters, bicycles) alongside other common vehicle types.

Model Details

  • Architecture: YOLOv8n (Ultralytics)
  • Task: Object Detection
  • Base weights: yolov8n.pt (fine-tuned)
  • Training epochs: 25
  • Image size: 640x640
  • Batch size: 16

Classes

IDClass
0auto_rickshaw
1bicycle
2bus
3car
4motorcycle
5pickup
6scooter
7truck
8van

Performance (final epoch)

MetricValue
Precision0.865
Recall0.695
mAP500.752
mAP50-950.624

See confusion_matrix.png and results.png in this repo for detailed training curves.

Usage

bash
pip install ultralytics
python
from ultralytics import YOLO

# Load model directly from the Hub
model = YOLO("https://huggingface.co/Madan11/two-wheeler-detector/resolve/main/best.pt")

results = model.predict("path/to/image.jpg", conf=0.25, save=True)

Or download the weights first with huggingface_hub:

python
from huggingface_hub import hf_hub_download
from ultralytics import YOLO

model_path = hf_hub_download(repo_id="Madan11/two-wheeler-detector", filename="best.pt")
model = YOLO(model_path)
results = model.predict("path/to/image.jpg", conf=0.25, save=True)

Intended Use

Detecting and classifying vehicles (with emphasis on two-wheelers) in images, video, or webcam streams — e.g. traffic monitoring, parking analysis, or road-safety applications.

Limitations

  • Trained on a custom dataset; performance may vary on data with different lighting, camera angles, or geographic/vehicle-style distributions not represented in training.
  • Recall (0.695) is lower than precision, meaning the model is more likely to miss some vehicles than to falsely detect non-vehicles — tune the confidence threshold as needed for your use case.