DFKonHF/yolov11n_car_plates_detector
๐ค [yolov11ncarplates_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
๐ Some training curves
<table> <tr> <td align="center"> <img src="lossplot.png" width="95%" alt="train/val total loss versus epoch"> <br><b>Training Loss</b> </td> <td align="center"> <img src="map5095_plot.png" width="95%" alt="mAP50-95 versus epoch"> <br><b>mAP50-95 Metric</b> </td> </tr> </table>
๐ผ๏ธ Examples: prediction during validation
<p align="center"> <img src="valbatch0pred.jpg" width="95%" alt="val batch prediction"> </p>
๐ 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
