Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mobassir94 opened this issue Jun 14, 2022 · 1 comment
Open

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

mobassir94 opened this issue Jun 14, 2022 · 1 comment

Comments

@mobassir94
Copy link

i was trying to generate bangla text recognition synthetic dataset using synthtiger like this : #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.

@monzzzz
Copy link

monzzzz commented May 24, 2024

make sure that you extract the font using this:
python tools/extract_font_charset.py -w 4 fonts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants