TextRecognitionDataGenerator icon indicating copy to clipboard operation
TextRecognitionDataGenerator copied to clipboard

Why use image height param 'format' as font size ?

Open lyy-zz opened this issue 6 years ago • 1 comments

I noticed that you used image height param format as the font size. https://github.com/Belval/TextRecognitionDataGenerator/blob/33d8985521645280e102987e773bf1e424a045df/TextRecognitionDataGenerator/computer_text_generator.py#L14 In my test, image_font = ImageFont.truetype(font=font_size=500), no error was reported, but it was time consuming. So I am confused, why set format, font_size to the same value? ImageFont Module — Pillow (PIL Fork) 3.1.2 documentation

lyy-zz avatar Aug 28 '19 02:08 lyy-zz

I do agree that it ends up being a stupidly high value, the idea was just to keep the font size consistent so it wouldn't look terrible after up scaling. In your tests, was 32 sufficient as a font size, or do we need a logic to convert the given format to a reasonable font size?

Thank you for bringing it up too.

Belval avatar Aug 28 '19 03:08 Belval