Update app.py
Browse files
app.py
CHANGED
|
@@ -94,7 +94,12 @@ def plot_outlines(img, masks):
|
|
| 94 |
return pil_img
|
| 95 |
|
| 96 |
def plot_overlay(img, masks):
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
img -= img.min()
|
| 99 |
img /= img.max()
|
| 100 |
HSV = np.zeros((img.shape[0], img.shape[1], 3), np.float32)
|
|
|
|
| 94 |
return pil_img
|
| 95 |
|
| 96 |
def plot_overlay(img, masks):
|
| 97 |
+
if img.ndim>2:
|
| 98 |
+
img_gray = img.astype(np.float32).mean(axis=-1)
|
| 99 |
+
else:
|
| 100 |
+
img_gray = img.astype(np.float32)
|
| 101 |
+
|
| 102 |
+
img = normalize99(img_gray)
|
| 103 |
img -= img.min()
|
| 104 |
img /= img.max()
|
| 105 |
HSV = np.zeros((img.shape[0], img.shape[1], 3), np.float32)
|