提交 4068429a 编写于 作者: S storyicon

fix: Coordinate 'right' is less than 'left'

Signed-off-by: Nstoryicon <storyicon@foxmail.com>
上级 e73a7e40
...@@ -9,8 +9,8 @@ def get_crop_region(mask, pad=0): ...@@ -9,8 +9,8 @@ def get_crop_region(mask, pad=0):
if box: if box:
x1, y1, x2, y2 = box x1, y1, x2, y2 = box
else: # when no box is found else: # when no box is found
x1, y1 = mask_img.size x1 = y1 = 0
x2 = y2 = 0 x2, y2 = mask_img.size
return max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask_img.size[0]), min(y2 + pad, mask_img.size[1]) return max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask_img.size[0]), min(y2 + pad, mask_img.size[1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册