TextRecognitionDataGenerator icon indicating copy to clipboard operation
TextRecognitionDataGenerator copied to clipboard

Empty or ? character results on synthesize Ja text

Open AICampB4 opened this issue 3 years ago • 3 comments

Hello, Your work is very amazing! But when I run command trdg -l ja -c 10 -w 5 to synthesize 10 images with Japanese text, I have got 10 images with empty content or ? character content. I tried both on Google Colab and My PC (Windows 10). I installed japanese lanaguage package to my OS but the result is same as before. Here the capture when I run on Google Colab, and on Pc has same result. Could you help me out, please.
Capture

AICampB4 avatar Mar 01 '22 10:03 AICampB4

Any feedback on this please!

I'm facing the same issue with the Japanese language. Text is generated properly but the images are empty or having question marks(? ? ?)

aziz-ullah-khan avatar Jun 02 '22 09:06 aziz-ullah-khan

@AICampB4 @aziz-ullah-khan

That's odd. I test on my machine and it works well.

(py3.9) gachiemchiep:tmp$ trdg -l ja -c 10 -w 5
(py3.9) gachiemchiep:tmp$  pip freeze | grep trdg
trdg==1.7.0

1 output image is like this 陸松 暴雨 はせべひろし としすけ 笠木トンネル_0

Would you mind searching inside trdg installed path and checking whether "TakaoMincho.ttf" file exists? The above error is caused by the missing font. I guess "TakaoMincho.ttf" is missing or couldn't be found. A quick fix is using the "--font_dir" options. First, you copy Japanese fonts (TTF files, other types are not usable now) into 1 directory called "ja_fonts". Then run the command like this. The above error should be disappeared.

trdg -l ja -c 10 -w 5 --font_dir ja_fonts

gachiemchiep avatar Jun 02 '22 14:06 gachiemchiep

set font_dir param, tell where the font your langguage use

SilvaQ avatar Jul 12 '22 07:07 SilvaQ