We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e2b177c + 821adc3 commit 8f64dadCopy full SHA for 8f64dad
modules/masking.py
@@ -16,7 +16,7 @@ def get_crop_region_v2(mask, pad=0):
16
mask = mask if isinstance(mask, Image.Image) else Image.fromarray(mask)
17
if box := mask.getbbox():
18
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
+ 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
20
21
22
def get_crop_region(mask, pad=0):
0 commit comments