License_plate_V_2 / README.md
Sompote's picture
Upload 6 files
7ced5c0 verified

A newer version of the Streamlit SDK is available: 1.42.2

Upgrade
metadata
title: Thai License Plate Detection V1.2
emoji: πŸš—
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.29.0
app_file: app.py
pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Thai License Plate Recognition App

This Streamlit application performs Thai license plate detection and recognition using deep learning models.

Features

  • License plate detection using YOLO
  • Character recognition for Thai license plates
  • Province name detection and recognition
  • Real-time processing with visual feedback
  • User-friendly web interface

Setup

  1. Install the required dependencies:
pip install -r requirements.txt
  1. Download the required model files and place them in the models directory:

    • best.pt - YOLO model for license plate detection
    • read_char.pt - YOLO model for character recognition
  2. Ensure the configuration file config/data.yaml is present with character mappings.

Running the Application

To run the application:

streamlit run app.py

The application will be available at http://localhost:8501 by default.

Usage

  1. Open the application in your web browser
  2. Click the "Choose an image..." button to upload an image containing a Thai license plate
  3. Wait for the processing to complete
  4. View the results:
    • Detected license plate number
    • Detected province name
    • Visual detection results

Models

The application uses three main models:

  1. YOLO model for license plate detection
  2. YOLO model for character recognition
  3. TrOCR model for province text recognition (automatically downloaded)

Directory Structure

streamlitapp/
β”œβ”€β”€ app.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ best.pt
β”‚   └── read_char.pt
└── config/
    └── data.yaml

Notes

  • The application requires an internet connection for the first run to download the TrOCR model
  • Supported image formats: JPG, JPEG, PNG
  • For optimal results, ensure the license plate is clearly visible in the image