Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -151,12 +151,11 @@ class Dataset(BaseDataset):
|
|
151 |
# read data
|
152 |
image = cv2.imread(self.images_fps)
|
153 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
154 |
-
|
155 |
-
mask = cv2.imread(self.masks_fps)
|
156 |
|
157 |
mask[np.where(mask < 8)] = 0
|
158 |
mask[np.where(mask > 8)] = 255
|
159 |
-
#
|
160 |
masks = [(mask == v) for v in self.class_values]
|
161 |
mask = np.stack(masks, axis=-1).astype('float')
|
162 |
|
|
|
151 |
# read data
|
152 |
image = cv2.imread(self.images_fps)
|
153 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
154 |
+
mask = cv2.imread(self.masks_fps, 0)
|
|
|
155 |
|
156 |
mask[np.where(mask < 8)] = 0
|
157 |
mask[np.where(mask > 8)] = 255
|
158 |
+
# extract certain classes from mask (e.g. polyp)
|
159 |
masks = [(mask == v) for v in self.class_values]
|
160 |
mask = np.stack(masks, axis=-1).astype('float')
|
161 |
|