Car License Plate Detection (PP-OCRv5 Mobile)

This repository contains a PP-OCRv5 Mobile detection model fine-tuned for Car License Plate Detection. The model is built using the PaddleOCR framework and provides improved accuracy and efficiency over v4.

Model Details

  • Model Type: Text Detection (optimized for license plates)
  • Algorithm: DB (Differentiable Binarization)
  • Architecture: PP-OCRv5 Mobile
  • Backbone: PPLCNetV3
  • Training Epochs: 10
  • Input Shape: [3, 640, 640]

Dataset

The model was trained on the Car License Plate Detection dataset from Kaggle, which consists of images with bounding box annotations for license plates.

How to Use

1. Installation

To use this model, you need to install paddlepaddle and paddleocr:

pip install paddlepaddle paddleocr

2. Inference Code

You can use the following snippet to run detection on an image:

from paddleocr import PaddleOCR
from pathlib import Path

# Path to the directory containing the downloaded model files
MODELS_DIR = Path("path/to/models")

# Initialize the OCR engine
pp_v5 = PaddleOCR(
    use_textline_orientation=True, 
    lang='en', 
    device='cpu', 
    text_detection_model_dir=str(MODELS_DIR / "ppocr_v5"),
    text_detection_model_name="PP-OCRv5_mobile_det"
)

img_path = 'car_image.jpg'
result = pp_v5.ocr(img_path, det=True, rec=False)

# Visualize results
for line in result:
    for box in line:
        print(f"Detected License Plate Box: {box}")

Repository Structure

  • config.yml: Training configuration.
  • inference.pdiparams: Model weights for inference.
  • inference.yml: Inference-specific configuration.
  • best_accuracy.pdparams: Best model weights during training.
  • run_summary.json: Summary of the training run.

Credits

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support