](https://github.com/ituvtu/smart-barrier-ai)
Smart Barrier AI is an intelligent vehicle access control system designed to automate gate operations. It utilizes a fine-tuned YOLOv10m model for license plate detection and EasyOCR for text recognition, enhanced by robust image preprocessing and region-specific post-processing logic.
- High-Precision Detection: Uses a custom-trained YOLOv10m model to accurately locate license plates in various lighting conditions.
- Advanced OCR Pipeline: Implements EasyOCR with a custom preprocessing stage (upscaling, denoising, adaptive thresholding) to handle low-quality images.
- Region Enforcer Logic:
- 🇺🇦 Ukraine: Enforces specific standard structure (
LL DDDD LL) with sliding window analysis and character correction. - 🇪🇺 Europe: Adaptive filtering for EU plates (stripping country codes and artifacts).
- 🇺🇦 Ukraine: Enforces specific standard structure (
- Fuzzy Matching: Smart database verification that accounts for common OCR typos (e.g.,
0vsO,8vsB). - Interactive UI: A user-friendly web interface built with Gradio featuring simulated LED status indicators and real-time logs.
-
Clone the repository:
git clone https://github.com/ituvtu/smart-barrier-ai.git cd smart-barrier-ai -
Install dependencies:
pip install -r requirements.txt
-
Verify Model Weights: Ensure that the fine-tuned model weights file
best.ptis located in the root directory.
Run the application locally:
python app.py
Open your browser and navigate to the local URL provided in the terminal (usually http://127.0.0.1:7860).
- Upload an image of a vehicle.
- Select the region mode (e.g., Ukraine 🇺🇦).
- Populate the "Database" field with allowed license plates (comma-separated).
- Click "Check Access" to see the detection result and access decision.
app.py- Main entry point containing the Gradio interface and pipeline orchestration.utils.py- Core logic for text cleaning, regex pattern matching, and fuzzy search algorithms.requirements.txt- Python dependencies.best.pt- Fine-tuned YOLOv10m weights (ensure this file is present).
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Author: ituvtu