Giter Site home page Giter Site logo

apoorva-dave / licenseplatedetector Goto Github PK

View Code? Open in Web Editor NEW
330.0 13.0 112.0 64.22 MB

Detects license plate of car and recognizes its characters

Python 100.00%
machine-learning license-plate-recognition license-plate-detection image-recognition video-recognition

licenseplatedetector's Introduction

Hello I'm Apoorva Dave

Visitor count

About me

I am a Software Engineer based out of Hyderabad. I run a youtube channel ๐ŸŽฅ on programming stuff and I try to learn in this process. I sometimes blog (ML/AI stuff) and tweet (mostly dog/cat videos) ๐Ÿ˜›

๐Ÿ”ญ Superpower I wish I had

I wish I could be teleported, travel across space and distance instantly. ๐ŸŒŒ

๐Ÿ“ซ How to reach me:

licenseplatedetector's People

Contributors

apoorva-dave avatar dependabot[bot] avatar wirahim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

licenseplatedetector's Issues

LicensePlateDetector-master\SegmentCharacters.py", line 10, in <module> license_plate = np.invert(DetectPlate.plate_like_objects[0]) IndexError: list index out of range

Hi, @apoorva-dave I am trying to detect licence plate number using your code and it is working like a charm for videos but I am facing some issue while detecting number from an image. In DetectPlate.py I am trying to pass the image path in this line car_image =image from my folder But after this, I am getting the following error.

LicensePlateDetector-master\SegmentCharacters.py", line 10, in license_plate = np.invert(DetectPlate.plate_like_objects[0]) IndexError: list index out of range

I tried to rectify by checking other files but no luck yet. Any help would be highly appreciated.

Can't replicate the test results

When when I run the code from DetectPlate.py on the first picture from README.md, this is the result I get
image

On car6.jpg and car.png it works perfectly.

I also comment this part of the code

car_image = imutils.rotate(car_image, 270)

Can the shape of the image affect the accuracy?
Please help.

Issue with training?

I'm not sure what the issue is here. I have decent character segmentation from the license plate and the training model reported good accuracy. Any tips?

char_seg
accuracy
fail

Request for Detailed Steps and Suggestions for Model Training and Parameter Adjustment

Firstly, I am very interested in your license plate recognition project and I believe it is a very useful tool. However, I encountered some issues while trying to set up and run the project.

In the README.md file, you mentioned training the model using SVC and provided a pre-trained model. However, I believe it would be very helpful for users like me if more detailed steps on how to train the model and suggestions on how to adjust the model parameters were provided.

In addition, I would also like to know more about how to train the model using my own dataset. I believe this would make the project more versatile and able to handle more real-world situations.

Lastly, I would like to ask if it is possible to provide a more detailed tutorial on how to set up and run this project from scratch? I believe this would be very helpful for novice users.

Thank you for your time and I look forward to your reply.

testing accuracy is low

I use same image and and mode that you posted in git but for me it predict bad for example(7 as Z 3 as 8 and S as 8) so please use more data to training and reupload the model it will be better for beginner like me
otherwise the everything is fine model as well as segment extraction is good

Multiple Vehicles

Hi, When i am giving input of multiple cars(through a video)but it is generating only one frame of any random car. it should shows every car. How can i detect multiple cars in the video..

Windows 10 Fresh Install

Run in cmd:

ECHO Python python-3.8.5-amd64
ECHO Git-2.28.0-64-bit
CD /D "D:\Wide\jetoil_mod"
"D:\DEV\python385winx64\python.exe" -m pip install --upgrade pip
pip3 install virtualenv
virtualenv --python "D:\DEV\python385winx64\python.exe" venv
.\venv\Scripts\activate
REM GOTO method2
git clone https://github.com/apoorva-dave/LicensePlateDetector
CD LicensePlateDetector
pip3 install -r requirements.txt
python PredictCharacters.py

Get error:

Traceback (most recent call last):
  File "PredictCharacters.py", line 1, in <module>
    import SegmentCharacters
  File "D:\Wide\jetoil_mod\LicensePlateDetector\SegmentCharacters.py", line 4, in <module>
    from skimage.measure import regionprops
  File "D:\Wide\jetoil_mod\venv\lib\site-packages\skimage\__init__.py", line 125, in <module>
    from .util.dtype import (img_as_float32,
  File "D:\Wide\jetoil_mod\venv\lib\site-packages\skimage\util\__init__.py", line 17, in <module>
    from ._map_array import map_array
  File "D:\Wide\jetoil_mod\venv\lib\site-packages\skimage\util\_map_array.py", line 2, in <module>
    from ._remap import _map_array
ImportError: DLL load failed while importing _remap: The specified module could not be found.

Fix by editing SegmentCharacters.py and import matplotlib before skimage

import numpy as np
import matplotlib
from skimage.transform import resize
from skimage import measure
from skimage.measure import regionprops
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import DetectPlate

How do I use different input?

I'm sorry, but I am not very familiar with digital image processing.
Could you explain to me further how can I use different input, eg, my own video?
It didn't detect the car plate properly, sometimes it gave me index out of range, I am guessing this is because it completely did not detect something at all in the video.
Is it because I have to train the program to detect the font of my car plate in my video?
If so, how can I do that?

Sorry and thank you, would really appreciate your help because this is very important to me.

gray and silver car not working.

hello,
i really like your work and your approach to resolving the challenges in this field.
however, while using your solution, I found several issues
while, gray, and silver-painted car will not work, or may work but will be detected several plate even if it's not a plate.
i can share with you the pictures and videos i have been using if you wanna improve your solution .
thank you

How to train my own data?

Hi thanks for your work, but i try to train my own data, what details in .py need to modify?
thanks

when i run it with my car video of my country i see a error

Traceback (most recent call last):
File "PredictCharacters.py", line 1, in
import SegmentCharacters
File "E:\License\LicensePlateDetector-master\SegmentCharacters.py", line 11, in
license_plate = np.invert(DetectPlate.plate_like_objects[0])
IndexError: list index out of range

What is the content of DetectPlate.plate_like_objects[]? and how to fix issues?
Can you tell me how to recognize license plate with two line characters in the license plate?

Output not correct

Hi there
I am a student of bachelors and i am making a project related to your work, i am looking for a code in which an image of a video of a car is given as an input and it in return it gives is number plate,
i came across your code and it was really good but the problem is that it is not extracting right number on the number plate, if i give it more images in training data will it become correct then?
or if you can suggest me something, i will be very glade
And also if you know some other codes or work related to my project, you can suggest me i will really glad
Thank you so much
Looking forword to your reponse

Trying to unpickle estimator SVC

UserWarning: Trying to unpickle estimator SVC from version 0.19.1 when using version 0.19.2. This might lead to breaking code or invalid results. Use at your own risk. UserWarning)
I wonder if you can provide us with more information or support us with Scikit-learn v0.19.1 as i can assume it causes that proplem

Index out of range

When we try it for image it shows error index out of range.
What changes should be made to handle this error in case of image taken?

When I execute, this error is showing

Traceback (most recent call last):
File "DetectPlate.py", line 26, in
car_image = imread("./output/frame%d.jpg"%(count-1), as_grey=True)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/_io.py", line 97, in imread
img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 209, in call_plugin
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins/pil_plugin.py", line 23, in imread
im = Image.open(fname)
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2258, in open
fp = builtins.open(filename, "rb")
IOError: [Errno 2] No such file or directory: './output/frame-1.jpg'

increase images in tarining module

When training the data set if we increase the no of images give an error
raise FileNotFoundError("No such file: '%s'" % fn)
FileNotFoundError: No such file: 'C:\sw\pyproject\LicensePlateDetector-master\train20X20\0\0_11.jpg'

ValueError: too many value to unpack

Hi, when I try to run the code on the default video12.mp4, it shows me two images and then throws and error.
otsuiamge
videimage

$ python PredictCharacters.py
C:\Users\mohit\Anaconda3\lib\site-packages\skimage\filters\thresholding.py:271:                                                                                                                                   UserWarning: threshold_otsu is expected to work correctly only for grayscale ima                                                                                                                                  ges; image shape (1080, 1920, 3) looks like an RGB image
  warn(msg.format(image.shape))
Traceback (most recent call last):
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\backends\backend_q                                                                                                                                  t5.py", line 519, in _draw_idle
    self.draw()
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\backends\backend_a                                                                                                                                  gg.py", line 433, in draw
    self.figure.draw(self.renderer)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\artist.py", line 5                                                                                                                                  5, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\figure.py", line 1                                                                                                                                  475, in draw
    renderer, self, artists, self.suppressComposite)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 14                                                                                                                                  1, in _draw_list_compositing_images
    a.draw(renderer)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\artist.py", line 5                                                                                                                                  5, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", li                                                                                                                                  ne 2607, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 14                                                                                                                                  1, in _draw_list_compositing_images
    a.draw(renderer)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\artist.py", line 5                                                                                                                                  5, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 59                                                                                                                                  3, in draw
    renderer, renderer.get_image_magnification())
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 84                                                                                                                                  1, in make_image
    unsampled=unsampled)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 50                                                                                                                                  6, in _make_image
    self.get_filternorm() or 0.0, self.get_filterrad() or 0.0)
ValueError: 3-dimensional arrays must be of dtype unsigned byte, unsigned short,                                                                                                                                   float32 or float64
Traceback (most recent call last):
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\backends\backend_q                                                                                                                                  t5.py", line 519, in _draw_idle
    self.draw()
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\backends\backend_a                                                                                                                                  gg.py", line 433, in draw
    self.figure.draw(self.renderer)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\artist.py", line 5                                                                                                                                  5, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\figure.py", line 1                                                                                                                                  475, in draw
    renderer, self, artists, self.suppressComposite)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 14                                                                                                                                  1, in _draw_list_compositing_images
    a.draw(renderer)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\artist.py", line 5                                                                                                                                  5, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", li                                                                                                                                  ne 2607, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 14                                                                                                                                  1, in _draw_list_compositing_images
    a.draw(renderer)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\artist.py", line 5                                                                                                                                  5, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 59                                                                                                                                  3, in draw
    renderer, renderer.get_image_magnification())
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 84                                                                                                                                  1, in make_image
    unsampled=unsampled)
  File "C:\Users\mohit\Anaconda3\lib\site-packages\matplotlib\image.py", line 50                                                                                                                                  6, in _make_image
    self.get_filternorm() or 0.0, self.get_filterrad() or 0.0)
ValueError: 3-dimensional arrays must be of dtype unsigned byte, unsigned short,                                                                                                                                   float32 or float64
(1080, 1920, 3)
Traceback (most recent call last):
  File "PredictCharacters.py", line 1, in <module>
    import SegmentCharacters
  File "D:\Applied Machine Learning\LicensePlateDetector\SegmentCharacters.py",                                                                                                                                   line 7, in <module>
    import DetectPlate
  File "D:\Applied Machine Learning\LicensePlateDetector\DetectPlate.py", line 7                                                                                                                                  6, in <module>
    min_row, min_col, max_row, max_col = region.bbox
ValueError: too many values to unpack (expected 4)

FileNotFoundError - cannot find ./output/frame106.jpg

I cloned the repository and tried to run the project with Pycharm IDE. But its throwing a FileNotFoundError: No such file: '...\LicensePlateDetector\output\frame106.jpg'
please help, I'm a beginner with python and ML

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.