ankandrew / fast-plate-ocr

Lightweight & fast OCR models for license plate text recognition.
https://ankandrew.github.io/fast-plate-ocr
MIT License
54 stars 13 forks source link

Contribute to new OCR #14

Open ankandrew opened 1 month ago

ankandrew commented 1 month ago

I don't have other plates cropped and annotated, other than Argentinian ones. I guess this would be beneficial to create a more universal plate OCR. Feel free to contribute with annotated plates and I'll gladly train more models!

I have also started going in the direction of creating synthetic data to train the models, see this arg_plate_dataset_plus_synth.zip, which was used to train argentinian-plates-cnn-synth-model. My thought is that training model with different fonts and more variety could make this OCR even more useful!

So any contributions are appreciated!

VitalyVaryvdin commented 1 month ago

I'm currently going through training on Russian license plates. So far after training on 50k images and achieving accuracy of 1 it's able to recognize only one type of the plates we have in Russia. I'll be able to share pretrained weights once I thoroughly test it.

However I'm currently looking into incorporating STN into fast-plate-ocr like LPRNet does that. There's lots of challenging angles in my use case, where fast-plate-ocr fails to correctly recognize the plate.

For the rest of the plate types I'm also going to use synthetic data since there's very little usable data available. My biggest concern is two row plates - there is like 16 different types of them and they're pretty different. Is fast-plate-ocr able to recognize two row plates as good as one row plates, btw?

offtopic: I'll get back to #13 tomorrow after doing the benches. I'll be able to test ONNX CPU, OpenVINO CPU & GPU on Intel 1360p some time later as well

ankandrew commented 1 month ago

After giving a quick look at LPRNet and STN papers, I agree with you, and seems it can definitely help in scenarios challenging angles. It would be really cool to see LPRNet model as part of the model zoo!

Regarding the two row plates, the new model (argentinian-plates-cnn-synth-model) does a very good job at recognizing them. I re-generated 500 bike plates randomly and the new model got all of them correctly. I attach below the test.

Validate on unseen two-row plates 1. Download 500 generated two-row plates [synthethic_dataset_gh_issue_14.zip](https://github.com/ankandrew/fast-plate-ocr/files/15327085/synthethic_dataset_gh_issue_14.zip) 2. Download https://github.com/ankandrew/fast-plate-ocr/releases/download/arg-plates/arg_cnn_ocr_synth.keras 3. Validate ```shell fast_plate_ocr valid \ --model ~/Downloads/arg_cnn_ocr_synth.keras \ --config-file ~/Downloads/arg_cnn_ocr_config.yaml \ --annotations ~/Downloads/synthethic_dataset_gh_issue_14/two_row_plates.csv ``` _Note: out of these 500, just 1 plate was actually in the training set (generated randomly)_.

The train data for the argentinian-plates-cnn-synth-model consisted of 19% of these types of plates.