LPlateVision / README.md
DeepActionPotential's picture
Update README.md
91d7130 verified

A newer version of the Streamlit SDK is available: 1.54.0

Upgrade
metadata
title: LPlateVision  YOLO-based License Plate Detection
emoji: 🚗
colorFrom: yellow
colorTo: blue
sdk: streamlit
sdk_version: 1.40.0
app_file: app.py
pinned: false
license: mit

license_plate_predicition — YOLOv8 License Plate Detection 📸🚀

A lightweight Streamlit app that loads a trained YOLOv8 model and detects license plates in images with an intuitive chat-style UI.


Badges

License: MIT Python


Table of Contents


Demo

The repository includes real demo assets under ./demo/.

  • Screenshot: ./demo/demo.png

    demo
  • Video: ./demo/demo.mp4


Features

  • YOLOv8 inference via ultralytics for license plate detection.
  • Chat-style Streamlit UI to upload an image or paste an image URL.
  • On-image annotations with bounding boxes.
  • Single-command launch with Streamlit.

Installation / Setup

Use a virtual environment for isolation.

# Create a virtual environment
python -m venv .venv

# Activate it
# On Linux/Mac:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate

# Upgrade pip (recommended)
pip install --upgrade pip

# Install dependencies
pip install -r requirements.txt

Usage

  • Make sure you have a YOLOv8 model file at ./models/model.pt (see Configuration).
  • Launch the app:
streamlit run app.py
  • In the app UI (app.py calling render_chat_ui() in ui.py):
    • Choose "Upload Image" and provide a .jpg/.jpeg/.png, or
    • Choose "Image URL" and paste a direct image URL.
    • Click "Detect License Plate" to run inference. The result image with bounding boxes will be displayed.

Programmatic highlights:

  • Model loading: utils.load_model() uses ultralytics.YOLO and Streamlit caching.
  • Inference: utils.detect_license_plate() runs model.predict() and returns an annotated image.

Configuration / Options

  • Model path: app.py loads ./models/model.pt once at startup.
    • Replace this file with your trained YOLOv8 weights.
    • You can retrain with Ultralytics and export to .pt.
  • Confidence threshold: Set in utils.detect_license_plate() (default conf=0.25). Adjust as needed.
  • Image inputs:
    • Upload via Streamlit file uploader.
    • Provide a URL; the app fetches it using requests and decodes with OpenCV.

Contributing

Contributions are welcome! Please:

  1. Fork the repo.
  2. Create a feature branch.
  3. Commit changes with clear messages.
  4. Open a pull request describing the motivation and changes.

For larger changes, consider opening an issue first to discuss the proposal.


License

This project is licensed under the MIT License. See LICENSE for details.


Acknowledgements / Credits