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

出现assert width > height无限循环 #60

Open
MrZWJax opened this issue Jul 15, 2019 · 3 comments
Open

出现assert width > height无限循环 #60

MrZWJax opened this issue Jul 15, 2019 · 3 comments

Comments

@MrZWJax
Copy link

MrZWJax commented Jul 15, 2019

运行过程中一开始没有问题,过一会儿就会出现assert width > height,然后一直循环在这个报错中,请问怎么解决

after pick font
After draw_text_on_bg
after pick font
Retry gen_img:
Traceback (most recent call last):
File "main.py", line 67, in gen_img_retry
return renderer.gen_img(img_index)
File "/home/mrzwjax/PycharmProjects/text_renderer/textrenderer/renderer.py", line 50, in gen_img
bg = self.gen_bg(width=word_size[0] * 8, height=word_size[1] * 8)
File "/home/mrzwjax/PycharmProjects/text_renderer/textrenderer/renderer.py", line 403, in gen_bg
bg = self.gen_bg_from_image(int(width), int(height))
File "/home/mrzwjax/PycharmProjects/text_renderer/textrenderer/renderer.py", line 425, in gen_bg_from_image
assert width > height

@uceclz0
Copy link

uceclz0 commented Feb 13, 2020

同样遇到了该问题,是在设置了背景图之后,请问您解决了吗

@zhangyingying520
Copy link

同样遇到了该问题,是在设置了背景图之后,请问您解决了吗

同问,一加背景图就出问题

@tronghieuit
Copy link

def gen_bg_from_image(self, width, height):
    """
    Resize background, let bg_width>=width, bg_height >=height, and random crop from resized background
    """
    if height >= width:
        height = width - 1
    assert width > height
    ......

I edited the code to be able to run the code with 1 character @uceclz0 @zhangyingying520 @MrZWJax

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

4 participants