Skip to content

This repository provides a process to analyse License Plate Kaggle data, and detect, and classify license plates on cars.

Notifications You must be signed in to change notification settings

Sanjay9921/Automatic-Number-Plate-Recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Automatic Number Plate Recognition using OpenCV and PyTorch

This project implements a deep learning pipeline for automatic number plate detection using OpenCV for preprocessing and PyTorch for model development, training, and inference. It includes all code for loading annotated datasets, preprocessing images and labels, training a bounding box regression model, and visualizing results on test images.

Project Overview

Automatic Number Plate Recognition (ANPR) is an essential computer vision tool for smart transportation and surveillance. In this project, images are processed using OpenCV, and a convolutional neural network (ResNet18 backbone) is trained with PyTorch to predict the bounding boxes of number plates in vehicle images. All bounding box targets are normalized to ensure efficient regression and accurate localization.

Features

  • Loads and processes annotated datasets with OpenCV.
  • Trains a lightweight PyTorch model for bounding box regression.
  • Visualizes predictions and bounding boxes on test images.
  • Uses TensorBoard to track loss and validation metrics.
  • Code is modular for quick experimentation and transfer learning.

Installation

  1. Clone this repository:
git clone <your-repo-url>
cd <your-repo-directory>
  1. Install required Python packages:
pip install torch torchvision opencv-python plotly scikit-learn pillow tensorboard
  1. (Optional) Start TensorBoard to monitor training:
tensorboard --logdir object_detection
  1. Dataset
  • Place your annotated image dataset in the correct directory structure (e.g., /input/number-plate-detection/).
  • Annotations should provide [xmin, xmax, ymin, ymax] coordinates for number plate bounding boxes per image.

Usage

  1. Data Preparation and Preprocessing:
  • After configuring dataset paths, run the notebook or python scripts to preprocess images and labels using OpenCV and convert them to PyTorch tensors.
  1. Model Training:
  • Execute training cells/scripts. Loss and validation metrics are logged to TensorBoard.
  1. Prediction and Visualization:
  • Run inference on new images. Predicted bounding boxes will be rendered on the images for easy verification.

Technologies Used

  • OpenCV (image loading, visualization, preprocessing)
  • PyTorch (deep learning, modeling, training, inference)
  • torchvision (pretrained models, transforms)
  • scikit-learn (data splitting)
  • TensorBoard (training monitoring)
  • Plotly (visualization)

Credits

About

This repository provides a process to analyse License Plate Kaggle data, and detect, and classify license plates on cars.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published