Ashoka74 commited on
Commit
274c822
1 Parent(s): 72b258e

Update app_3.py

Browse files
Files changed (1) hide show
  1. app_3.py +4 -4
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[first_mask].shape
1115
  # get the bounding box of alpha
1116
- y, x = np.where(alpha[first_mask])
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[first_mask].shape
1278
  # get the bounding box of alpha
1279
- y, x = np.where(alpha[first_mask])
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