Instructions to use Madan11/two-wheeler-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use Madan11/two-wheeler-detector with ultralytics:
from ultralytics import YOLOvv8 model = YOLOvv8.from_pretrained("Madan11/two-wheeler-detector") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
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
| ID | Class |
|---|---|
| 0 | auto_rickshaw |
| 1 | bicycle |
| 2 | bus |
| 3 | car |
| 4 | motorcycle |
| 5 | pickup |
| 6 | scooter |
| 7 | truck |
| 8 | van |
Performance (final epoch)
| Metric | Value |
|---|---|
| Precision | 0.865 |
| Recall | 0.695 |
| mAP50 | 0.752 |
| mAP50-95 | 0.624 |
See confusion_matrix.png and results.png in this repo for detailed training curves.
Usage
pip install ultralytics
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:
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.
- Downloads last month
- -