Downloads · 30 days
0
MKgoud/License-Plate-Character-Detector
License-Plate-Character-Detector is a object detection model from MKgoud. Use it when you need objects located in an image. The card lists the license as mit.
This repository contains a YOLOv8-based model for detecting characters in license plates. The model is trained to identify and localize individual characters on vehicle license plates, which can be useful for various…
Downloads · 30 days
0
Access
Public
Updated Aug 31, 2024
Repo size
208 MB
Likes
9
Public
Click a slice to open those files.
.pt208 MB · 100%
From the Hugging Face model README
This repository contains a YOLOv8-based model for detecting characters in license plates. The model is trained to identify and localize individual characters on vehicle license plates, which can be useful for various applications such as automated parking systems, traffic monitoring, and vehicle identification.

This image demonstrates the model's ability to detect and localize individual characters on a license plate. The bounding boxes show the detected characters.
To use this model, you'll need to have Python installed along with the following dependencies:
pip install ultralytics
pip install torch
pip install huggingface_hub
Here's a basic example of how to use the model:
from ultralytics import YOLO
import cv2
import numpy as np
# Load the YOLOv8 model
model = YOLO('path/to/your/best.pt') # Load your trained model
# Read the image
image = cv2.imread('path/to/your/image.jpg')
# Run inference on the image
results = model(image)
# Process the results
for result in results:
boxes = result.boxes.cpu().numpy() # Get bounding boxes
for box in boxes:
# Get box coordinates
x1, y1, x2, y2 = box.xyxy[0]
x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)
# Draw bounding box
cv2.rectangle(image, (x1, y1), (x2, y2), (0, 255, 0), 2)
# If you have class names, you can add them to the image
if box.cls is not None:
label = f"{result.names[int(box.cls[0])]} {box.conf[0]:.2f}"
cv2.putText(image, label, (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 255, 0), 2)
# Save or display the result
cv2.imwrite('output_image.jpg', image)
# Or to display (if running in an environment with GUI):
# cv2.imshow('Result', image)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
If you want to train the model on your own dataset:
Our model achieves an overall accuracy of [97.12]% on the test set. Here's a breakdown of accuracy for each character:

Below is the confusion matrix for our model, showing its performance across all characters:

This matrix provides insights into which characters are most often confused with each other, helping to identify areas for potential improvement.

For any questions or feedback, please open an issue in this repository.