Table of Contents
This project aims to develop a system which can detect Bangladeshi license plate (Bangla characters) and recognizes the characters in the license plate.The licenese plate information will be saved in a xls file along with some other informations such as location,time,cropped picture of the license plate and an unique id for each deteced license plate.
***Cite the dataset:
M. H. Tusar, M. T. Bhuiya, M. S. Hossain, A. Tabassum and R. Khan, "Real Time Bangla License Plate Recognition with Deep Learning Techniques," 2022 IEEE International Conference on Artificial Intelligence in Engineering and Technology (IICAIET), 2022, pp. 1-6.***
-
Raspberry Pi 4B (optional)
-
Raspberry Pi Camerav2 (optional)
Before getting started, we need to have some data,software and access to some websites which is necessary for this project.
- Bangladeshi Bangla License Plate Dataset
- Anconda or Pycharm for model training
- Alernatively, we could also use Google Colab or similiar kind of cloud platform for model training
- A webcam if raspberry pi with its cmaera is not used
- To train the model we will use google colab and run the whole project we will use anconda or terminal in case of raspberry pi.First,we need to create a virtual environment in anaconda.To create a virtual environment,open anaconda promt from start menu and enter following command
conda create -n {virtual environment name}
Activate the virtual environment by issuing:
conda activate {virtual environment name}
-
We have created virtual environment.Now we need to prepare our data to train the model.We have already created a dataset of Bangladeshi license plate and it can be downloded from this link: Bangla License Plate.In all, there are 295 images with annotations in the dataset.And they are splitted into three parts;train(70%), valid(20%) and test(10%).Now to preapre the dataset for training we will use roboflow.They has a guidline on how to prepare a dataset for taining. We will use colab to train our yolov5 model.We could also use anaconda or pycharm to train the model in local machine.
-
We trained the model in colab and downloaded the weights from colab.Two trained weights yolov5s & yolov5n will be included in this repository.
-
Now make a directory in your preferable drive and create a folder where we will store all the necessery files.So,if needed, we change the directories in anaconda command prompt and create a folder and change directories to that folder.
mkdir <folder name>
cd <folder name>
- Now we clone yolov5 repository to this folder by issuing:
git clone https://github.com/ultralytics/yolov5 .
We need to delete the default detect.py that comes with yolov5 directory by using following command:
del detect.py
We will clone this repository for customized detect.py and trained weights.
git clone https://github.com/MahmudolHasan/Real-Time-Bangladeshi-License-Plate-Detection-And-Recognition .
We need to install and import python packages to run the detection by using:
pip install -r requirements.txt
we also need to install easyocr and xlswriter by issuing:
pip install easyocr==1.4.0
pip install xlsxwriter
pip install uuid
Now run following command to real time detect license plate:
python detect.py --weights yolov5s.pt --img 320 --conf 0.5 --source 0 --save-crop
Note: use '--save-crop' argument to save the license plate information in an .xls file.