TextRecognitionDataGenerator
TextRecognitionDataGenerator copied to clipboard
Text generation does not support new line
When generating text from strings I noticed the newlines are not preserved within the image
Within the _computer_text_generator.py, _generate_horizontal_text method I see the following loop:
for i, c in enumerate(text): txt_draw.text( (sum(char_widths[0:i]) + i * character_spacing, 0), c, fill=fill, font=image_font, )
Seems like the y axis is 0?
I am happy to do a pull request for this if you are ok. Also do you see any issues for doing this?
TRDG in its current state only does single lines of text. I do agree that this could change, but there would probably be a greater impact across the codebase.
Feel free to try your hand at it, I would accept a PR for it, but expect me to be a little more picky when reviewing due to the importance of the feature.
Otherwise, I expect to do it myself before the end of 2019.
Hi thank you so much for this really useful library as well as for your prompt response, I have changed it for my use case locally. If I can manage to get it work for all use cases I will send a pull request. Thanks