Downloads · 30 days
0
orionwambert/yolov8-license-plate-detection
yolov8-license-plate-detection is a machine learning model from orionwambert. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A custom-trained YOLOv8 model for license plate detection, trained on a dataset from Roboflow with 100 epochs on CPU.
Downloads · 30 days
0
Access
Public
Updated Oct 11, 2025
Repo size
39 MB
Likes
0
Public
Click a slice to open those files.
.pt36.9 MB · 95%
From the Hugging Face model README
A custom-trained YOLOv8 model for license plate detection, trained on a dataset from Roboflow with 100 epochs on CPU.
Based on validation results on 70 images with 218 instances:
pip install ultralytics
conda install -c conda-forge ultralytics
from ultralytics import YOLO
# Load the trained model
model = YOLO('best.pt')
# Run inference on an image
results = model('path/to/your/image.jpg')
# Display results
results[0].show()
# Save results
results[0].save('output.jpg')
from ultralytics import YOLO
import os
# Load the model
model = YOLO('best.pt')
# Process multiple images
input_dir = 'path/to/input/images'
output_dir = 'path/to/output'
for filename in os.listdir(input_dir):
if filename.lower().endswith(('.jpg', '.jpeg', '.png')):
image_path = os.path.join(input_dir, filename)
results = model(image_path)
results[0].save(os.path.join(output_dir, f'detected_{filename}'))
from ultralytics import YOLO
# Load the model
model = YOLO('best.pt')
# Process video file
results = model('path/to/video.mp4')
# Process webcam stream
results = model(source=0, show=True)
from ultralytics import YOLO
# Load model with custom settings
model = YOLO('best.pt')
# Run inference with custom parameters
results = model(
'image.jpg',
conf=0.5, # Confidence threshold
iou=0.7, # IoU threshold for NMS
max_det=300, # Maximum detections
show=True, # Display results
save=True, # Save results
save_txt=True # Save results in YOLO format
)
from ultralytics import YOLO
model = YOLO('best.pt')
results = model('image.jpg')
# Extract detection information
for result in results:
boxes = result.boxes # Boxes object for bbox outputs
masks = result.masks # Masks object for segmentation masks outputs
keypoints = result.keypoints # Keypoints object for pose outputs
probs = result.probs # Probs object for classification outputs
# Get bounding boxes coordinates
if boxes is not None:
for box in boxes:
# Get coordinates
x1, y1, x2, y2 = box.xyxy[0].tolist()
confidence = box.conf[0].item()
class_id = int(box.cls[0].item())
print(f"License Plate detected at: ({x1:.2f}, {y1:.2f}, {x2:.2f}, {y2:.2f})")
print(f"Confidence: {confidence:.2f}")
The model was trained with the following parameters:
# Key training parameters
epochs: 100
batch: 16
imgsz: 640
device: cpu
workers: 8
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
patience: 100
# Data augmentation
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 1.0
mixup: 0.0
cutmix: 0.0
best.pt: Best model weights based on validation metricslast.pt: Last epoch model weightsargs.yaml: Training configuration fileIf you use this model in your research, please cite:
@software{yolov8_license_plates,
title={License Plate Detection using YOLOv8},
author={Your Name},
year={2024},
url={https://huggingface.co/your-username/yolo-plates-detection}
}
This model is available under the MIT License. See LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions and support, please open an issue in the repository.