lucashmsilva / SimpleLPR

This is a simple LPR system implemented in python using Machine Learning and image processing techniques
GNU General Public License v3.0
2 stars 0 forks source link

Can't make it work #1

Open Y-Solo opened 5 years ago

Y-Solo commented 5 years ago

Hello,

First, I would like to congratulate you for your work. I am not a professional programmer but I know the basics of python. I have installed all dependencies, extract dataset in imgs and launch python3.7 train.py. Once is done, I run "python3.7 predict.py".

It say : python3 predict.py [OPTIONS] [IMAGE FILENAME] -a Test with entire plate dataset (doesn't require filename) -t Test with one image (filiname must be provided )

I have tried : "python3.7 predict.py -t /path/to/my/file/hello.png" but it does not seem to work. It say again : python3 predict.py [OPTIONS] [IMAGE FILENAME] ... etc

Could you explain how to predict LPR from my file "hello.png" ? I use Apple MacOS, does it work on this OS ?

Thank you very much.

lucashmsilva commented 5 years ago

Hi @Y-Solo! First of all, thanks for showing interest in this!

Although this repo is relatively new, I made this in my second year in college (2-ish years ago), so there are maaaany things here I'd do different and some there are blatantly wrong (e.g. model validation metrics). Therefore, take any of this code with a ~ton~ grain of salt.

All that said, I cloned the code and tried to use myself and you were correct! It was not working with the instructions I provided. What you should do to get it working, is have a folder structure like this:

SimpleLPR/
      |---- imgs/
      |-------- dataset/
      |------------ 0/
      |------------ 1/
      |------------ 2/
      |------------ ...
      |------------ A/
      |------------ B/
      |------------ ...
      |---- plates/
      |-------- 066A007.png
      |-------- 785K686.png
      |-------- ...
      |----modes/ (created at run time)
      |----src/

So after you extract the dataset files, make sure to have the directory structure like this

Another thing that the unexperienced me did is force the images to be predicted inside the imgs/plates folder. This way you should put you image in there or use some of the images already in there. Bare in mind that the plate images are really only the plate. There is no plate detection or segmentation, so if you input a image with a car that happens to have a plate, the program will get all confused.

Another thing that I don't know if you did or not, is generate the models by running python train.py. This is fundamental because without the models it can't predict anything. if you run the command above without changing nothing, you will start training a handful of models and if I remember correctly it took a while in my laptop, so I'd change the last line from train.py to specify only the algorithms you want to use.

Make sure to git pull or download the repo again to get the latest changes I made to correct some stuff and made the error messages not suppressed .

If you need any help using the code or studying LPR, make sure to contact me here!