Spaces:
Runtime error
Runtime error
Sarah Yakum
commited on
Commit
•
fab6674
1
Parent(s):
48355a5
commit
Browse files
app.py
CHANGED
@@ -83,11 +83,10 @@ if file_name is not None:
|
|
83 |
for label, color in enumerate(palette):
|
84 |
color_seg[seg == label, :] = color
|
85 |
|
86 |
-
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
st.pyplot(plt.gcf())
|
|
|
83 |
for label, color in enumerate(palette):
|
84 |
color_seg[seg == label, :] = color
|
85 |
|
86 |
+
color_seg = color_seg[..., ::-1]
|
87 |
|
88 |
+
img = np.array(image) * 0.5 + color_seg * 0.5
|
89 |
+
img = img.astype(np.uint8)
|
90 |
+
plt.figure(figsize=(15, 10))
|
91 |
+
plt.title("Image with Segmentation")
|
92 |
+
st.pyplot(plt.gcf())
|
|