Update README.md
Browse files
README.md
CHANGED
|
@@ -98,10 +98,10 @@ def prepare_masked_image(
|
|
| 98 |
|
| 99 |
# Normalize mask to [0,1] float if it’s in [0,255]
|
| 100 |
|
| 101 |
-
if mask_np.max()
|
| 102 |
-
mask_norm = (mask_np / 255.0).astype(np.float32)
|
| 103 |
-
else:
|
| 104 |
mask_norm = mask_np.astype(np.float32)
|
|
|
|
|
|
|
| 105 |
|
| 106 |
# Expand mask to 3 channels if needed
|
| 107 |
if mask_norm.ndim == 2:
|
|
|
|
| 98 |
|
| 99 |
# Normalize mask to [0,1] float if it’s in [0,255]
|
| 100 |
|
| 101 |
+
if mask_np.max() <= 1:
|
|
|
|
|
|
|
| 102 |
mask_norm = mask_np.astype(np.float32)
|
| 103 |
+
else:
|
| 104 |
+
mask_norm = (mask_np / 255.0).astype(np.float32)
|
| 105 |
|
| 106 |
# Expand mask to 3 channels if needed
|
| 107 |
if mask_norm.ndim == 2:
|