Spaces:
Sleeping
Sleeping
A newer version of the Streamlit SDK is available:
1.54.0
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
Table of Contents
- Demo
- Features
- Installation / Setup
- Usage
- Configuration / Options
- Contributing
- License
- Acknowledgements / Credits
Demo
The repository includes real demo assets under ./demo/.
Screenshot:
./demo/demo.png
Video:
./demo/demo.mp4
Features
- YOLOv8 inference via
ultralyticsfor 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.pycallingrender_chat_ui()inui.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.
- Choose "Upload Image" and provide a
Programmatic highlights:
- Model loading:
utils.load_model()usesultralytics.YOLOand Streamlit caching. - Inference:
utils.detect_license_plate()runsmodel.predict()and returns an annotated image.
Configuration / Options
- Model path:
app.pyloads./models/model.ptonce 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()(defaultconf=0.25). Adjust as needed. - Image inputs:
- Upload via Streamlit file uploader.
- Provide a URL; the app fetches it using
requestsand decodes with OpenCV.
Contributing
Contributions are welcome! Please:
- Fork the repo.
- Create a feature branch.
- Commit changes with clear messages.
- 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
ultralytics— YOLOv8 model and inference utilities.streamlit— simple web app framework for ML demos.opencv-python,numpy, andPillowfor image handling and visualization.