synthtiger icon indicating copy to clipboard operation
synthtiger copied to clipboard

synthtiger can't render text that contain '\u200c'

Open mobassir94 opened this issue 2 years ago • 1 comments

i was trying to generate bangla text recognition synthetic dataset using synthtiger like this : https://github.com/clovaai/synthtiger/issues/25 i was able to generate many samples but sometimes it is failing by giving me this error :


Traceback (most recent call last):
  File "/home/apsisdev/.local/lib/python3.8/site-packages/synthtiger/gen.py", line 71, in _generate
    data = template.generate()
  File "/home/apsisdev/mobassir/bnsynthtiger/examples/synthtiger/template.py", line 109, in generate
    fg_image, label = self._generate_fg(fg_color, fg_style)
  File "/home/apsisdev/mobassir/bnsynthtiger/examples/synthtiger/template.py", line 182, in _generate_fg
    font = self.font.sample({"text": text, "vertical": self.vertical})
  File "/home/apsisdev/.local/lib/python3.8/site-packages/synthtiger/components/font/base_font.py", line 51, in sample
    path = meta.get("path", self._sample_font(text))
  File "/home/apsisdev/.local/lib/python3.8/site-packages/synthtiger/components/font/base_font.py", line 134, in _sample_font
    raise RuntimeError(
RuntimeError: There is no font that can render text 'র‌্যাডিসনে': /home/apsisdev/mobassir/bnsynthtiger/resources/font/bn

few more samples for what i got same error above :

  1. 'শুনি—বাংলাদেশি'
  2. 'কর‌্যা'
  3. 'জাতীয়'
  4. 'র‌্যাম্পের'
  5. 'র‌্যাব-পুলিশ'
  6. 'র‌্যাগিংয়ের'
text = 'র‌্যাব-পুলিশ'
[i for i in text]

we checked the failed samples with the code above, seems like synthtiger is not able to render words that contain '\u200c' not sure if there are any other failure cases though.

mobassir94 avatar Jun 14 '22 06:06 mobassir94