faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.37k stars 349 forks source link

How to fine tune the detector and the recogniser for a custom dataset? #194

Open Pusse-01 opened 2 years ago

Pusse-01 commented 2 years ago

Can anyone explain what is the format of the data or how is the dataset should be feeded to the model to fine tune. I have a set of images which have been labeled each and every character by drawing bounding boxes. So how I could fine tune the model using this data set to increase the accuracy of my model.

JackSadigov commented 2 years ago

Hi. I am also looking for the same here. I tried Convert PASCAL dataset to TFRecord for object detection in TensorFlow explained here but got an error with ''annotations has no object".

seansteel3 commented 1 year ago

@Pusse-01 and @JackSadigov here is an excellent guide that will take you through retraining: https://keras-ocr.readthedocs.io/en/latest/examples/end_to_end_training.html

There are two open issues related to: Detector Batch size: https://github.com/faustomorales/keras-ocr/issues/218 Recognizer retraining: https://github.com/faustomorales/keras-ocr/issues/231

For the recognizer retraining Oadon's solution worked for me, I did not attempt geo-tp's but it probably works too. Obviously make sure you're data is in the same format as the guide (or edit the guide accordingly) to retrain.