About β’ Features β’ Requirements β’ Installation β’ Usage β’ Performance β’ Contributing β’ License
PlateScanner is a production-ready system for automatic vehicle license plate detection and character recognition. Using YOLOv5 for detection and ONNX-based OCR for character recognition, it processes images end-to-end: detects plates, extracts regions, recognizes characters, and exports results to CSV.
Deploy on CPU for accessibility or GPU for high-throughput processing with Docker.
- π― End-to-End Pipeline - Automatic detection, cropping, and OCR
- π Global Support - Trained on 9,000+ images from 50+ countries
- π High Performance - 300+ plates/second on CPU, faster on GPU
- π 98% Accuracy - mAP@0.5 of 0.98 on detection task
- π³ Docker Ready - CPU and GPU variants included
- π Batch Processing - Process multiple images efficiently
- π CSV Export - Structured results with confidence scores
- Python: 3.10 - 3.12 (strongly recommended)
- Docker & Docker Compose: Optional but recommended
- GPU (Optional): NVIDIA with CUDA 11.0+ support
| Resource | Minimum | Recommended |
|---|---|---|
| Memory | 512 MB | 2 GB |
| Disk | 2 GB | 4 GB |
| CPU | 1 core | 4+ cores |
CPU Version:
git clone https://github.com/Paulogb98/PlateScanner.git
cd PlateScanner
# Download models and prepare images (see Setup below)
docker compose up -d --build platescanner-cpuGPU Version (NVIDIA):
# Install NVIDIA Container Toolkit first:
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
docker compose up -d --build platescanner-gpugit clone https://github.com/Paulogb98/PlateScanner.git
cd PlateScanner
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Download models and prepare images (see Setup below)
python src/main.pyModels are available on Google Drive.
Required files:
| File | Destination |
|---|---|
yolo_detector_model.pt |
models/detector/ |
config.json |
models/detector/ |
license_plates_ocr_model.onnx |
models/recognizer/ |
license_plates_ocr_config.yaml |
models/recognizer/ |
license_plates_ocr_results.json |
models/recognizer/ |
Place images in data/raw/ directory:
Supported formats: .jpg, .jpeg, .png
data/
βββ raw/
β βββ image1.jpg
β βββ image2.png
β βββ image3.jpeg
Docker:
docker compose up -d --build platescanner-cpu
docker compose logs -fPython:
python src/main.pyResults are available in data/results/ocr_results.csv:
Image Name,Extracted Value
image1.jpg,ABC1234
image2.jpg,XYZ9876
Processed images are in data/processed/:
detected/- Images with bounding boxescropped/- Extracted plate regions
- Place images in
data/raw/ - Run the application
- Check
data/results/ocr_results.csvfor results - Review annotated images in
data/processed/
from classes.detector import YOLOv5Inference
from classes.recognizer import ONNXPlateRecognizer
# Detection
detector = YOLOv5Inference("models/detector/yolo_detector_model.pt")
results = detector.infer("path/to/image.jpg")
detector.process_results(results, "image.jpg", output_dir="data/processed")
# Recognition
recognizer = ONNXPlateRecognizer(
"models/recognizer/license_plates_ocr_model.onnx",
"models/recognizer/license_plates_ocr_config.yaml"
)
recognizer.process_cropped_images("data/processed/cropped", "data/results")| Hardware | Speed | Throughput |
|---|---|---|
| CPU (8-core) | ~80ms/image | 12.5 plates/s |
| GPU (RTX 3060) | ~15ms/image | 67 plates/s |
| GPU (RTX 4090) | ~8ms/image | 125 plates/s |
| Metric | Value |
|---|---|
| Detection mAP@0.5 | 0.98 |
| Character Accuracy | ~93% |
| Supported Formats | 50+ countries |
| Dataset Size | 9,000+ images |
PlateScanner/
βββ classes/
β βββ detector.py # YOLOv5 detection
β βββ recognizer.py # ONNX OCR
βββ data/
β βββ raw/ # Input images
β βββ processed/
β β βββ detected/ # Images with boxes
β β βββ cropped/ # Plate regions
β βββ results/
β βββ ocr_results.csv # Results
βββ models/
β βββ detector/
β β βββ config.json
β β βββ yolo_detector_model.pt
β βββ recognizer/
β βββ license_plates_ocr_config.yaml
β βββ license_plates_ocr_model.onnx
β βββ license_plates_ocr_results.json
βββ src/
β βββ main.py
βββ docker-compose.yml
βββ Dockerfile
βββ requirements.txt
βββ README.md
Ensure NVIDIA Container Toolkit is installed:
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
docker run --rm --gpus all nvidia/cuda:11.0-runtime nvidia-smiDownload from Google Drive and extract to correct directories.
Verify image quality and ensure license plates are clearly visible. Try with sample images first.
Reduce batch size or process images individually. Consider using CPU version with smaller images.
To specialize the detection model for specific plate types:
yolov5 train \
--data data.yaml \
--img 640 \
--batch 16 \
--weights models/detector/yolo_detector_model.pt \
--epochs 10Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m 'feat: add YourFeature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
- Additional plate format support
- Performance optimizations
- Test datasets
- Documentation improvements
- Web API interface
- Cloud deployment guides
This project is licensed under the MIT License - see LICENSE for details.
Attribution: OCR modules adapted from fast_plate_ocr.
π§ Email: paulogb98@outlook.com
π LinkedIn: https://www.linkedin.com/in/paulo-goiss/
- Ultralytics - YOLOv5 framework
- ONNX - Model interoperability
- OpenCV - Computer vision library
- PyTorch - Deep learning framework
- fast_plate_ocr - OCR implementation reference
Built with β€οΈ using Python, PyTorch & ONNX
π Repository β’
π Issues β’
π¦ Releases
PlateScanner v1.0 | β Production Ready