ankush-me / SynthText

Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Vedaldi, Andrew Zisserman, CVPR 2016.
http://www.robots.ox.ac.uk/~vgg/data/scenetext/
Apache License 2.0
2.02k stars 622 forks source link

Some special characters are not generated #281

Open RivkinMikhail opened 1 year ago

RivkinMikhail commented 1 year ago

Hi! First of all thanks for such a great repo.

I've got a problem with generating images with some special characters, e.g. ":" or "%", however "-" character is generating correctly. When these characters are placed with some text ("dog%") there's no problem generating them, only for solo ones. I've tried to play with min_nchar parameter, but nothing helps. Looked through all issues, can't find something related to.

So, if anyone knows where should I look for I'll be very grateful for your help! image

ankush-me commented 1 year ago

There’s an explicit filter for strings containing all symbols (or some threshold fraction of symbols). You should look for it in the function check_symb_frac(self, txt, f=0.35) in text_utils.py

On 24 Aug 2023, at 3:17 pm, RivkinMikhail @.***> wrote:



Hi! First of all thanks for such a great repo.

I've got a problem with generating images with some special characters, e.g. ":" or "%", however "-" character is generating correctly. When these characters are placed with some text ("dog%") there's no problem generating them, only for solo ones. I've tried to play with min_nchar parameter, but nothing helps. Looked through all issues, can't find something related to.

So, if anyone knows where should I look for I'll be very grateful for your help!

— Reply to this email directly, view it on GitHubhttps://github.com/ankush-me/SynthText/issues/281, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFPAZKHU4P2MYEBYOOB7SDXW5O5XANCNFSM6AAAAAA35DITFM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

RivkinMikhail commented 1 year ago

@ankush-me thank you so much for such a quick response!

I've changed f=1.0 and min_nchar=1 parameters and is_good function now returns True for my text.

However, the images are still not generated. (Failure: No text placed.)

Could be please advise me, where should I look for more?

ankush-me commented 1 year ago

There are many steps in the process — best way to debug would be to put in a breakpoint to step through the code and see where the text is getting filtered out.

On 25 Aug 2023, at 10:05 am, RivkinMikhail @.***> wrote:



@ankush-mehttps://github.com/ankush-me thank you so much for such a quick response!

I've changed f=1.0 and min_nchar=1 parameters and is_good function now returns True for my text.

However, the images are still not generated. (Failure: No text placed.)

Could be please advise me, where should I look for more?

— Reply to this email directly, view it on GitHubhttps://github.com/ankush-me/SynthText/issues/281#issuecomment-1693030407, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFPAZNEDWRGOONMX73UF63XXBTFBANCNFSM6AAAAAA35DITFM. You are receiving this because you were mentioned.Message ID: @.***>