Skip to content

Commit 821adc3

Browse files
w-e-wBing-su
andcommitted
fix get_crop_region_v2
Co-Authored-By: Dowon <ks2515@naver.com>
1 parent e2b177c commit 821adc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/masking.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_crop_region_v2(mask, pad=0):
1616
mask = mask if isinstance(mask, Image.Image) else Image.fromarray(mask)
1717
if box := mask.getbbox():
1818
x1, y1, x2, y2 = box
19-
return max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask.size[0]), min(y2 + pad, mask.size[1]) if pad else box
19+
return (max(x1 - pad, 0), max(y1 - pad, 0), min(x2 + pad, mask.size[0]), min(y2 + pad, mask.size[1])) if pad else box
2020

2121

2222
def get_crop_region(mask, pad=0):

0 commit comments

Comments
 (0)