Spaces:
Sleeping
Sleeping
fix: double norm
Browse files
app.py
CHANGED
|
@@ -87,8 +87,7 @@ def interface(classifier):
|
|
| 87 |
# Use the normalized mask for visualization
|
| 88 |
mask_viz = (normalized_mask * 255).astype(np.uint8)
|
| 89 |
|
| 90 |
-
|
| 91 |
-
binary_for_overlay = normalized_mask > 0.5
|
| 92 |
overlay = image_np.copy()
|
| 93 |
overlay[~binary_for_overlay] = (overlay[~binary_for_overlay] * 0.3).astype(np.uint8)
|
| 94 |
|
|
@@ -103,8 +102,6 @@ def interface(classifier):
|
|
| 103 |
for class_name, prob in sorted_probs:
|
| 104 |
output_str += f"{class_name}: {prob*100:.2f}%\n"
|
| 105 |
|
| 106 |
-
mask_viz = (mask * 255).astype(np.uint8)
|
| 107 |
-
|
| 108 |
return [output_str, overlay, mask_viz]
|
| 109 |
|
| 110 |
demo = gr.Interface(
|
|
|
|
| 87 |
# Use the normalized mask for visualization
|
| 88 |
mask_viz = (normalized_mask * 255).astype(np.uint8)
|
| 89 |
|
| 90 |
+
binary_for_overlay = normalized_mask > 0.2
|
|
|
|
| 91 |
overlay = image_np.copy()
|
| 92 |
overlay[~binary_for_overlay] = (overlay[~binary_for_overlay] * 0.3).astype(np.uint8)
|
| 93 |
|
|
|
|
| 102 |
for class_name, prob in sorted_probs:
|
| 103 |
output_str += f"{class_name}: {prob*100:.2f}%\n"
|
| 104 |
|
|
|
|
|
|
|
| 105 |
return [output_str, overlay, mask_viz]
|
| 106 |
|
| 107 |
demo = gr.Interface(
|