Convert 1600 to a float.
If `unknown_image.shape[1] > 1600` then `scale_factor` will be always calculated `0` because `1600 / unknown_image.shape[1]` is an `int` over `int` division which in turn will always raise a ValueError in `PIL.Image.resize`. Making `1600` a float (1600.0) fixes the issue.
Showing
想要评论请 注册 或 登录