This project implements a character recognition pipeline for license plates using PyTorch and OpenCV. It supports:
- End-to-end character recognition pipeline
- CNN-based classifier
- Noise-resilient image preprocessing & augmentation
- Batch prediction and automatic annotation
- Tailored for Australian license plates
Input Image 1:
Predicted Output 1:
Input Image 2:
Predicted Output 2:
The model is trained on a subset of the Chars74K dataset (EnglishFnt.tgz
).
Only characters visually similar to Victorian license plates were manually retained to ensure performance on real-world data.
Download EnglishFnt.tgz
Extract to ./dataset/train/
Manually remove non-standard / stylized characters not visually aligned with Victorian plates
.
├── train.py # Training script
├── main.py # Main entry for prediction & visualization
├── preprocess.py # Contour detection and filtering logic
├── chopped.py # Postprocessing (resizing, border fixing, etc.)
├── dataset/ # Directory for /train and /test directories
├── input/ # Directory for input images to be recognized
├── output/ # Inference results with annotated predictions
├── char_cnn.pth # Trained model weights
python main.py Ensure images of car are in ./input. Annotated results will be saved to ./output.
- Chars74K Dataset
- OpenCV & PyTorch