Madan11/two-wheeler-detector
046
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
Performance (final epoch)
See confusion_matrix.png and results.png in this repo for detailed training curves.
Usage
pip install ultralyticsfrom 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:
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.
