sergiomsilva / alpr-unconstrained

License Plate Detection and Recognition in Unconstrained Scenarios
Other
1.72k stars 607 forks source link

how to train? #17

Open Tomhouxin opened 6 years ago

Tomhouxin commented 6 years ago

hello,Thank you very much for sharing the training code, but the training data has a TXT file. What does the number in the file mean? and how do you label it?

1 2

Tomhouxin commented 6 years ago

@sergiomsilva , Whether can train Chinese license plate directly?

sergiomsilva commented 6 years ago

Hi @Tomhouxin , the training script is only for the license plate detector, which is the core idea of our work. The data you mentioned describes the 4-corner points of a license plate in the image. Take a look at the REAME.txt file in http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/labels/training-dataset-annotations.zip for a detailed explanation.

Considering that our detector will probably work well on Chinese LPs, you just need to change and re-train the characters network or use another OCR of your choice for Chinese characters.

Tomhouxin commented 6 years ago

yeah. I known

danishansari commented 6 years ago

@Tomhouxin were you able to train lp-detector? I would appreciate if you can share some insight/experience on how to train and improve this on new dataset.

@sergiomsilva I used your trained model on my data set with a sample of 10 images and it detected license-plate on 6 images. These images contains randomly generated text sequence placed on some randomly selected backgrounds. I trained this model using your model as initial weights, on the three sample images that you provided for 1000 iterations and tested on my sample images, it worked well on 7 images. The loss started from 6.3 and reduced to 1.7 . While when I trained it on the same sample data of 10 images for 1000 iterations, loss started from 207 and reduced to 5, but the result is really bad now, its not detecting any of lp's and detecting few false lp's. Please find the images with labels in the link provided. Any hint or suggestions will be appreciated, thanks.

sergiomsilva commented 6 years ago

@danishansari you are overfitting the model, its impossible to train with 10 samples. Moreover, the samples in your link are artificial, so I don't know if the model will converge or not even with thousands of them.

I provided 3 samples just for illustration purposes, to understand how to use the script. In fact, we used 200 samples.

danishansari commented 6 years ago

@sergiomsilva The model is not working on the same sample data, on which it was trained, so over-fitting might not be the problem. I also tried it with 100, 8k and 64k image samples and its not working at all. I guess it's the problem with learning rate, the initial model is modified too much in the process of training(1000 iterations) without learning any useful features from the new data. What is the initial learning rate and decay mechanism used, is there any way to control learning rate? Please correct me if i am wrong.

danishansari commented 6 years ago

@sergiomsilva Or is there any problem with annotations?

sergiomsilva commented 6 years ago

@danishansari you can check your annotations by using the readShapes function in label.py and draw_losangle function in drawing_utils.py... if your annotations are correct you will see in the resulting image.

pangyanhui923 commented 6 years ago

Hi,@Tomhouxin ,I also plan to use this data set to train myself to recognize Chinese license plates. May I ask how is the progress of you in using this data set to recognize Chinese license plates?Can you share your experience with me?thank you

linzhi123 commented 6 years ago

Hello, I found a problem that the data tagged by train-detector/txt file is different from that described by README.txt. For example: 00011.txt file:

(0.237361, 0.333657, 0.328102, 0.229583, 0.643439, 0.643439, 0.721136, 0.720577)* (W, H)

The coordinates obtained are: (151,141,209,97,411,272,461,605). It is found that the position of the license plate in 00011.jpg is inconsistent with that of the license plate in 00011.jpg.

And your description in README.txt is:

N = number or corners (fixed in 4)

TL [x, y] = top left corner

Tr [x, y] = top right corner

Br [x, y] = bottom right corner

BL [x, y] = bottom left corner

So is your train-detector/file wrong or is README.txt wrong? @sergiomsilva

linzhi123 commented 6 years ago

Is it in this order? N,tlx,trx,brx,blx,tly,try,bry,bly,LABEL, Or in this order? N,tlx,tly,trx,try,brx,bry,blx,bly,LABEL, @sergiomsilva

sergiomsilva commented 6 years ago

@linzhi123 I updated the README from the zip file 1 month ago, please take a look at issue #15

ht88889 commented 5 years ago

@Tomhouxin @danishansari @pangyanhui923 I also plan to train myself to recognize Chinese license plates. May I ask how is the progress of you in using this data set to recognize Chinese license plates?Can you share your experience with me?thank you