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.38k stars 355 forks source link

Ability to pass a custom essential_generators.DocumentGenerator() to data_generation.get_text_generator() #130

Open ivsanro1 opened 3 years ago

ivsanro1 commented 3 years ago

https://github.com/faustomorales/keras-ocr/blob/v0.8.5/keras_ocr/data_generation.py#L119

When training from scratch, and especially for different languages, I would like to train a custom DocumentGenerator given my text dataset. It would be as simple as set an optional parameter gen=None to the function get_text_generator of data_generation. If it's None, then create it as it's being created now.