πŸ€– [yolov11n_car_plates_detector]

πŸ“ Description

This model is aimed to detect car registration plates and based on ultralytic's yolov11. It can be used as a good start for training a more sophisticated CV system.

πŸ—‚οΈ Dataset

The custom dataset is based on 7091 open source images that were labeled mostly manually and partly automatically using open-source foundation models. The car plates are mostly from CH, HK, MO regions, but also include a small fraction of other types for diversity. It contains 11.87% images without target objects in order to increase it's ability to distinguish background from the objects. Images were split into train/val/test in 80/10/10 proportion with stratification with respect to the presence or absence of the target objects. The dataset includes photos in challenging situations: multiple plates on a single car, cases when only a fraction of a number is seen (up to a single symbol), motion blurred, and sometimes augmentations where the number is erased or altered.

🎯 Most important metrics

Metric train val test
Precision 0.9874 0.9754 0.9743
Recall 0.9895 0.9711 0.9653
mAP@50 0.9934 0.9901 0.9885
mAP@50-95 0.9238 0.8845 0.8849

πŸ“ˆ Some training curves

train/val total loss versus epoch
Training Loss
mAP50-95 versus epoch
mAP50-95 Metric

πŸ–ΌοΈ Examples: prediction during validation

val batch prediction

πŸ“‹ Requirements

Usage Example was tested with:

  • ultralytics version 8.3.180
  • huggingface_hub version 0.36.0
  • cv2 version 4.10.0

Installing dependencies:

pip install -r requirements.txt

πŸš€ Try demo now in Spaces right now! Hugging Face Spaces

πŸš€ Usage Example

from ultralytics import YOLO
from huggingface_hub import hf_hub_download
import cv2 

# downloading weights
weights_path = hf_hub_download(
    repo_id="DFKonHF/yolov11n_car_plates_detector",
    filename="best_n.pt",
    repo_type="model"
)
# instantiating a model
model = YOLO(weights_path)
# setting class name
model.model.names = {0: 'plate'}

# Set input/output image paths
input_img_path = 'your/path/to_image.jpg'
output_img_path = 'annotated_image.jpg'
# Inference
results = model(input_img_path)

# Annotate image with predictions (bbox + label - "{class_name} {conf}")
for result in results:
    # Get annotated image with boxes and labels
    annotated_img = result.plot()
    
    # Saving annotated image
    cv2.imwrite(output_img_path, annotated_img)

⚠️ Limitations

  • Trained primarily on CH/HK plates; performance may drop on other formats
  • Extremely small plates may be missed
  • Heavy motion blur or extreme angles can reduce accuracy
  • Does not perform OCR β€” only detects plate location
Downloads last month
68
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using DFKonHF/yolov11n_car_plates_detector 1