huzey commited on
Commit
3101a51
1 Parent(s): 30e4b09

fix seg app

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3371,8 +3371,8 @@ with demo:
3371
  combined_mask = noisy_mask * 0.4 + clean_mask
3372
  combined_mask = np.clip(combined_mask, 0, 255).astype(np.uint8)
3373
  if overlay_image:
3374
- combined_mask[:, :, 0] = 0 # remove red channel
3375
- combined_mask[:, :, 1] = 0 # remove green channel
3376
  _image = original_images[i_image].convert("RGB").resize((combined_mask.shape[1], combined_mask.shape[0]))
3377
  _image = np.array(_image)
3378
  combined_mask = 0.5 * combined_mask + 0.5 * _image
 
3371
  combined_mask = noisy_mask * 0.4 + clean_mask
3372
  combined_mask = np.clip(combined_mask, 0, 255).astype(np.uint8)
3373
  if overlay_image:
3374
+ # add empty red and green channel
3375
+ combined_mask = np.stack([np.zeros_like(combined_mask), np.zeros_like(combined_mask), combined_mask], axis=-1)
3376
  _image = original_images[i_image].convert("RGB").resize((combined_mask.shape[1], combined_mask.shape[0]))
3377
  _image = np.array(_image)
3378
  combined_mask = 0.5 * combined_mask + 0.5 * _image