CyberAgentAILab / derendering-text

Other
76 stars 8 forks source link

for prerendering, 0-dimensional alpha_crop causes resize error. #4

Open junhocho opened 2 years ago

junhocho commented 2 years ago

I appreciate the provided code and tried myself.

For the prerendering script python -m util_lib.gen_pams

Following resize code causes error: https://github.com/CyberAgentAILab/derendering-text/blob/0273325a29054cb16a4b4d30466f837df6c62b10/util_lib/gen_pams.py#L95

This is beause why alpha_crop = crop_alpha_area(alpha) results some (0,n) or (n,0) shaped array, therefore resize is impossible. To deal with this, I temporarily altered code and checked how this issue as following:

image

and this is following logs:

image

Is this ok? Looks like lots of crop errors occur and result resizing error.

junhocho commented 2 years ago

test code and the demo with jupyter notebook seemingly work, but still i wonder if you have faced same issue on prerendering

shimoda-uec commented 2 years ago

I expect most of these errors from the lack of glyphs for the specific characters in font files. We handle 94 characters, and font files sometimes do not have glyphs for all characters. We ignore such characters whose glyph does not exist.