Skip to content

Commit

Permalink
fix: Coordinate 'right' is less than 'left'
Browse files Browse the repository at this point in the history
Signed-off-by: storyicon <storyicon@foxmail.com>
  • Loading branch information
storyicon committed Apr 10, 2024
1 parent e73a7e4 commit 4068429
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def get_crop_region(mask, pad=0):
if box:
x1, y1, x2, y2 = box
else: # when no box is found
x1, y1 = mask_img.size
x2 = y2 = 0
x1 = y1 = 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])


Expand Down

0 comments on commit 4068429

Please sign in to comment.