Belval / TextRecognitionDataGenerator

A synthetic data generator for text recognition
MIT License
3.15k stars 943 forks source link

bugfixes for Hindi text generation #333

Open prathameshza opened 5 months ago

prathameshza commented 5 months ago

Bugfix for Hindi text generation

bug 1: No Hindi text rendering in official trdg pypi package 1.8.0

reproduce results with:

trdg -l hi -c 10 -w 5

image

गरमटयए जतवन टकटकत फफकर बरत_0

text

गरमटयए जतवन टकटकत फफकर बरत

Using official repository

bug 2: Hindi text don't have matras and matras in image are seperated!

reproduce results with:

git clone https://github.com/Belval/TextRecognitionDataGenerator.git

cd TextRecognitionDataGenerator/trdg/

python3 run.py -l hi -c 10 -w 5

Before bug fix

image

एकशरयत ठठकन ललत-षषठ बखन तर_0

text

एकशरयत ठठकन ललत-षषठ बखन तर

After bug fix

image

कलपाओ घिघियाता हँसोहीं मकी डंडा-डोलिओं_0

text

कलपाओ घिघियाता हँसोहीं मकी डंडा-डोलिओं

Changes made

Note: Changing the font also changes the images created per second

Below is the tested font and their speeds for Hindi image generation

Font Speed
Lohit-Devanagari 15-16 it/s
Gargi 17-18 it/s
Sura unicode 11-12 it/s
akshra unicode 4-5 it/s
Kurti dev 010 50-55 it/s
aakar regular 50-55 it/s
freesansbold 9-10 it/s
Nakula 8-9 it/s

I am using Linux Mint 21.3 "Virginia" Cinnamon Edition for testing

I have also tested other languages with the modified changes, they work fine :+1:

abhi-glitchhg commented 3 months ago

Thanks for this work.

abhi-glitchhg commented 3 months ago

But, stll there is problems with the generated images.

image

if you see the second and last word, they are not matching and generating some invalid text.