TextRecognitionDataGenerator
TextRecognitionDataGenerator copied to clipboard
Data Generator working manner
@Belval @bact @junxnone @yifeitao @gachiemchiep Hello! Thanks a lot for this great Generator! Please What is the specific caracteristics of these synthetic images generated by these tools? How can it proceeds when the input is an image containing a text(how it takes the text and generate images) Thanks a lot for your help!
@Tailor2019 Sorry I don't understand your question.
@gachiemchiep Thanks for your interest about my question I mean what operations effected on a text to generate these synthetic data? what difference between the 1000 generated images? Thanks in advance!
@Tailor2019 Each image is generated using
- randomly selected text from a dictionary file
- randomly selected font from font directory
- random select color value from a color range
- randomly select a background image / or color
So generated images are randomness. All you can do is collect as many fonts as possible and large enough background images. Personally, I use MINC-2500 dataset as background images.
Thanks for your reply!
@gachiemchiep
when I'm using the option "-d" that Defines an image directory to use when background is set to image
I'm using this image:
But after generation of the data the background of the images is
as these images:

Please how it effect these background? did it take an horizontally part of the image used for the background? How it mesure its width? did it take another background from the folder images of this prject(for example the last image) ? Thanks to help me understand !
@Tailor2019 The logic of using background images is defined inside this method. https://github.com/Belval/TextRecognitionDataGenerator/blob/ab83b94fd10ecdace77c77fddb2727d8e4c85289/trdg/background_generator.py#L58
The background image is randomly crop and resize. You can change it to fit your need.
thanks a lot it is very helpful! @gachiemchiep for this option -hw there use of "model-29.data-00000-of-00001" in this case the generator will use the model to predict the text in the image or what? Thanks to explain this .