Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def inference(image, chosen_model):
|
|
36 |
color_seg = np.zeros((seg.shape[0], seg.shape[1], 3), dtype=np.uint8) # height, width, 3
|
37 |
palette = np.array([[0, 0, 0],[255, 255, 255]])
|
38 |
for label, color in enumerate(palette):
|
39 |
-
color_seg[seg == label
|
40 |
# Convert to BGR
|
41 |
color_seg = color_seg[..., ::-1]
|
42 |
img = np.array(image) * 0.5 + color_seg * 0.5
|
|
|
36 |
color_seg = np.zeros((seg.shape[0], seg.shape[1], 3), dtype=np.uint8) # height, width, 3
|
37 |
palette = np.array([[0, 0, 0],[255, 255, 255]])
|
38 |
for label, color in enumerate(palette):
|
39 |
+
color_seg[seg == label] = color
|
40 |
# Convert to BGR
|
41 |
color_seg = color_seg[..., ::-1]
|
42 |
img = np.array(image) * 0.5 + color_seg * 0.5
|