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

[Bug]: --Font-size and --font-size-minimal doesn't work #728

Open
popcion opened this issue Nov 2, 2024 · 1 comment
Open

[Bug]: --Font-size and --font-size-minimal doesn't work #728

popcion opened this issue Nov 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@popcion
Copy link
Contributor

popcion commented Nov 2, 2024

Issue

您好,我单独使用font_size或font_size minimal进行字体固定和设置最小字体会失灵。由于图片大小原因,font size常常需要固定在100甚至以上,我尝试固定为80似乎对部分文字不起作用,又尝试将其固定为40,所有文字都变小了,似乎是起了作用,整体来看确实起了作用,但是这些较小字体大小仍有差异。当我将设置的数字增大时,字体又不固定了,我用默认字体仍会出现这个问题,我想应该和字体没有太大关联。而对于font_size_minimal,我将其设置为很大的数字,例如100,最终的文字结果中仍有个别会出现非常小的字,明显是小于我设置的100。默认OCR48px,默认检测器。

[EDIT]
我想font_size不像文档中说的是固定字体大小,而是最大字体大小,因为设置后在一页漫画上的文字大小并不统一。而我将font_size和font_size minimal设置成同一数字,实现了固定字体大小。这样的话可以理解font_size的错误,但是仅添加font_size minimal而不添加font_size时出现的明显比font_size minimal设置中的数字更小的文字不能理解。很抱歉手上没有案例图,result被清空了,今后再遇到会在此添加。
再次测试将font_size minimal和font_size大小设置成同一数字(80),同一页大小未能统一

Command Line Arguments

python -m manga_translator -v --mode web --host=0.0.0.0 --port=5003 --inpainting-precision bf16 -l CHS --use-gpu --font-path='G:\tools\manga-image-translator\fonts\.ttf' --revert-upscaling --upscaler esrgan --upscale-ratio 2 --mask-dilation-offset 50

Console logs

[LamaLargeInpainter] Inpainting resolution: 2048x1312
[web_client] Running rendering
Task state ed61da3672c6e0e1c3b8a60e1d1dc79a350cacc3e76eb91ab1b8744a3ae51e14-2048-gpt3.5-CHS-default-auto to {'info': 'rendering', 'finished': False}
[render] font_size_minimum 120
[render]: 100%|██████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00,  5.76it/s]
Task state ed61da3672c6e0e1c3b8a60e1d1dc79a350cacc3e76eb91ab1b8744a3ae51e14-2048-gpt3.5-CHS-default-auto to {'info': 'finished', 'finished': False}
[web_client] Running downscaling
Task state ed61da3672c6e0e1c3b8a60e1d1dc79a350cacc3e76eb91ab1b8744a3ae51e14-2048-gpt3.5-CHS-default-auto to {'info': 'downscaling', 'finished': False}
[web_client] Saving "PATH"
@popcion popcion added the bug Something isn't working label Nov 2, 2024
@popcion
Copy link
Contributor Author

popcion commented Nov 2, 2024

#535
可能是相同问题be like

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant