Object Detection and Classification Charachter using YOLO and CNN
View the Project on GitHub ragilhadi/plate-recognition-yolo-cnn
These project is to detect the plate with label name of “papan” , these project only detect 1 class called “papan” . after that take the bounding box and get the text inside the bounding box. to get the text inside bounding box these project use 2 method first using my own trained CNN model and used the python package name easyocr . in the conclustion i compare the accuracy of CNN and easyocr.
Create bounding box for your dataset A bounding box is an imaginary rectangle that serves as a point of reference for object detection and creates a collision box for that object. these are the example of boundig box
You can label your dataset image using Labelimg or makesense.ai and choose the YOLO format or the file with extenstion *.txt
Create YOLO model for object detection in these project i use YOLOv5 to make object deteaction model. You can learn more about the yolo in the documentation link here
YOLO an acronym for ‘You only look once’, is an object detection algorithm that divides images into a grid system. Each cell in the grid is responsible for detecting objects within itself.
if you want to create your own object detection with custom dataset you can watch these helpful tutorial to achieve that in here
The result of training process
Preview test dataset
Create CNN model for classification A Convolutional Neural Network, also known as CNN or ConvNet, is a class of neural networks that specializes in processing data that has a grid-like topology, such as an image.
in these project CNN use to read the 3 first charachter text inside the bounding box. and in these project i use data augmentation to make more dataset.
CNN have only 11 label that is 0-9 and F
Create Segmentation for Charachter A segmentation is to takes an image as input and outputs a collection of regions (or segments) which can be represented as
in these project i use some code from these kaggle notebok to create segmentation to my plate
The result of my Segmentation
Wrap all the project code with all that model ready and the segmentation to get each charachter in the image ready. i wrap all into one folder to easily organize and i use some code from these github repo
git clone https://github.com/ragilhadi/plate-recognition-yolo-cnn
cd plate-recognition-yolo-cnn
pip install -r requirements.txt #for windows
pip3 install -r requirements.txt #for mac or windows
Note: You must have all the python package to run the project
python main.py #for windows
python3 main.py #for mac or linux
python camera.py #for windows
python3 camera.py #for mac or linux
python image_ocr.py #for windows
python3 image_ocr.py #for mac or linux
python camera_ocr.py #for windows
python3 camera_ocr.py #for mac or linux
This preview of the image with CNN to classify the text
This preview of the image with easyocr to classify the text
the result of these method to recognize the text inside the plate be depicted in these picture