Spaces:
Running
on
Zero
Running
on
Zero
Update app_3.py
Browse files
app_3.py
CHANGED
@@ -1111,9 +1111,9 @@ def process_image(input_image, input_text):
|
|
1111 |
# mask_mover.set_extracted_fg(cropped_rgba)
|
1112 |
|
1113 |
# alpha = img[..., 3] > 0
|
1114 |
-
H, W = alpha
|
1115 |
# get the bounding box of alpha
|
1116 |
-
y, x = np.where(alpha
|
1117 |
y0, y1 = max(y.min() - 1, 0), min(y.max() + 1, H)
|
1118 |
x0, x1 = max(x.min() - 1, 0), min(x.max() + 1, W)
|
1119 |
|
@@ -1274,9 +1274,9 @@ def process_image(input_image, input_text):
|
|
1274 |
# mask_mover.set_extracted_fg(cropped_rgba)
|
1275 |
|
1276 |
# alpha = img[..., 3] > 0
|
1277 |
-
H, W = alpha
|
1278 |
# get the bounding box of alpha
|
1279 |
-
y, x = np.where(alpha
|
1280 |
y0, y1 = max(y.min() - 1, 0), min(y.max() + 1, H)
|
1281 |
x0, x1 = max(x.min() - 1, 0), min(x.max() + 1, W)
|
1282 |
|
|
|
1111 |
# mask_mover.set_extracted_fg(cropped_rgba)
|
1112 |
|
1113 |
# alpha = img[..., 3] > 0
|
1114 |
+
H, W = alpha.shape
|
1115 |
# get the bounding box of alpha
|
1116 |
+
y, x = np.where(alpha > 0)
|
1117 |
y0, y1 = max(y.min() - 1, 0), min(y.max() + 1, H)
|
1118 |
x0, x1 = max(x.min() - 1, 0), min(x.max() + 1, W)
|
1119 |
|
|
|
1274 |
# mask_mover.set_extracted_fg(cropped_rgba)
|
1275 |
|
1276 |
# alpha = img[..., 3] > 0
|
1277 |
+
H, W = alpha.shape
|
1278 |
# get the bounding box of alpha
|
1279 |
+
y, x = np.where(alpha > 0)
|
1280 |
y0, y1 = max(y.min() - 1, 0), min(y.max() + 1, H)
|
1281 |
x0, x1 = max(x.min() - 1, 0), min(x.max() + 1, W)
|
1282 |
|