Instructions to use DFKonHF/yolov11n_car_plates_detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use DFKonHF/yolov11n_car_plates_detector with ultralytics:
from ultralytics import YOLOvv11 model = YOLOvv11.from_pretrained("DFKonHF/yolov11n_car_plates_detector") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
π€ [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
Training Loss |
mAP50-95 Metric |
πΌοΈ Examples: prediction during validation
π Requirements
Usage Example was tested with:
ultralyticsversion 8.3.180huggingface_hubversion 0.36.0cv2version 4.10.0
Installing dependencies:
pip install -r requirements.txt
π Try demo now in Spaces right now!
π 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