mouseland commited on
Commit
bf308b6
·
verified ·
1 Parent(s): 16f935e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -94,7 +94,12 @@ def plot_outlines(img, masks):
94
  return pil_img
95
 
96
  def plot_overlay(img, masks):
97
- img = normalize99(img.astype(np.float32).mean(axis=-1))
 
 
 
 
 
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)