From 4068429ac72cd83e03abe779148bbe1d6a141a09 Mon Sep 17 00:00:00 2001 From: storyicon Date: Wed, 10 Apr 2024 10:53:25 +0000 Subject: [PATCH] fix: Coordinate 'right' is less than 'left' Signed-off-by: storyicon --- modules/masking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/masking.py b/modules/masking.py index 29a394527..9f5b0cd03 100644 --- a/modules/masking.py +++ b/modules/masking.py @@ -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])