Spaces:
Running
on
Zero
Running
on
Zero
fix seg app
Browse files
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 |
-
|
3375 |
-
combined_mask
|
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
|