app.py
CHANGED
@@ -91,8 +91,8 @@ def label_to_color_image(label):
|
|
91 |
if label.ndim != 2:
|
92 |
raise ValueError("Expect 2-D input label")
|
93 |
|
94 |
-
|
95 |
-
|
96 |
return colormap[label]
|
97 |
|
98 |
iface = gr.Interface(
|
|
|
91 |
if label.ndim != 2:
|
92 |
raise ValueError("Expect 2-D input label")
|
93 |
|
94 |
+
# Clip label values to be within the range of colormap
|
95 |
+
label = np.clip(label, 0, len(colormap) - 1)
|
96 |
return colormap[label]
|
97 |
|
98 |
iface = gr.Interface(
|