Git Product home page Git Product logo

kalyan1045 / automatic-number-plate-recognition-using-yolov5 Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 94.61 MB

The aim of this project was to create a model that can accurately detect number plates on cars and bikes.

Jupyter Notebook 52.05% Python 47.95%
alpr anpr computer-vision deep-learning machine-learning object-detection opencv python3 pytorch real-time yolov5 neural-network yolo

automatic-number-plate-recognition-using-yolov5's Introduction

Automatic Number Plate Detection ๐Ÿš˜

Screenshot-2023-05-28-001749.png

The goal of this project was to create a model that can accurately detect number plates on cars and bikes. This model can be used along with the video data generated from CCTV cameras that are installed on highways and roadways to detect number plate of vechicles that commit traffic violations.

โ„น๏ธ Model Information

Object Detection is carried out in this project to detect Number Plates on vehicles. YOLOv5s model was used along with transfer learning for training and testing. Model accurately generates bounding boxes around Number Plates

More Info on YOLOv5: https://github.com/ultralytics/yolov5

๐Ÿ“š Dataset

The dataset I used for training for Number plate detection:

โœ๏ธ Installation

install requirements.txt in a Python>=3.7.0 environment.

git clone https://github.com/KALYAN1045/Automatic-Number-Plate-Recognition-using-YOLOv5.git  # clone

cd Automatic-Number-Plate-Recognition-using-YOLOv5

pip install -r requirements.txt  # install

๐Ÿ” Implementation

Object Detection pipeline cinsists of 3 parts: Training, Validation and Testing

Training:

YOLOv5s was trained on Google Colab with following hyperparameters:

  • Input Image Size: 640
  • Batch Size: 16
  • Epochs: 300 (converged in 198 epochs)
  • Pretrained Weights: yolov5s.pt

The training dataset consisted of 400 images along with their class and bounding box details mentioned in a txt file in yolo format. The training was set to run for 300 epochs but the model converged in 198 epochs and the training was stopped.

Validation:

The validation dataset consisted of 100 images along with their class and bounding box details in a txt file in yolo format for validation purpose. In validation phase the model reached Mean Average Precision (mAP) of 0.91

Following are some of the image results generated in validation phase:

alt text

At the end of training and validation epochs, a weights file ("best.pt") is generated which consists of all the learned parameters of the model.

Refer to "ANPD_OD.ipynb" for more info about the training and validation process.

Testing Phase

The model was tested on various images and videos and the model generated accurate class and bounding box predictions. The weights file called "/weights/best.pt" that was generate in the training phase was used for inference in testing phase. Testing was carried out in PyTorch, and OpenCV was used when working with images and videos. OpenCV helped in loading, saving, drawing bounding boxes, and displaying text regarding class name and class confidence values.

๐Ÿ“ฆ Result

result.png

๐Ÿ“– Summary

An accurate object detection model was created to carry out Automatic Number Plate Recognition using YOLOv5 and transfer learning along with Pytorch. The accuracy of bounding boxes and the frame rate was found to be good.

๐Ÿ›‘ Limitations

  • Even though the accuracy and frame rate was good, the model sometimes wrongly detected various signs on road as number plate. A bigger dataset is required to improve upon the current model accuracy.
  • The model in its current state works very well on CUDA devices getting around 32 FPS but does perform well on CPU devices. Hence GPU hardware is required for smooth frame rate outputs.
  • It can't detect the number plates of bikes due to various factors and it also has a problem with the camera quality.

๐Ÿš€ Future works

  • A bigger dataset can be used to train the model for more number of epochs to reduce the false positive predictions.
  • This detection model can be uploaded on edge devices connected to CCTV cameras to carry out Number Plate Recognition live on the road.
  • CCTV video footage can be used to read number plate of vehicles that commit traffic violations.
  • The bounding box around the license plate can be cropped and Optical Character Recognition can be used to actually read the number plate.

โ™จ๏ธ Tech Stack

TensorFlow

PyTorch

Pandas

Python

NumPy

automatic-number-plate-recognition-using-yolov5's People

Contributors

kalyan1045 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gumotanxiang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.