Spaces:
Runtime error
Runtime error
BertChristiaens
commited on
Commit
•
6e3a1b8
1
Parent(s):
0cae6b6
add image
Browse files
app.py
CHANGED
@@ -155,9 +155,11 @@ def make_editing_canvas(canvas_color, brush, _reset_state, generation_mode, pain
|
|
155 |
with st.spinner(text="Preparing image segmentation"):
|
156 |
image = get_image()
|
157 |
print("Preparing image segmentation")
|
158 |
-
real_seg = segment_image(Image.fromarray(image))
|
159 |
st.session_state['seg'] = real_seg
|
160 |
# get unique RGB colors from this segmentation map
|
|
|
|
|
161 |
unique_colors = np.unique(real_seg.reshape(-1, real_seg.shape[2]), axis=0)
|
162 |
st.session_state['unique_colors'] = unique_colors
|
163 |
# multiselect to choose multiple colors
|
|
|
155 |
with st.spinner(text="Preparing image segmentation"):
|
156 |
image = get_image()
|
157 |
print("Preparing image segmentation")
|
158 |
+
real_seg = np.array(segment_image(Image.fromarray(image)))
|
159 |
st.session_state['seg'] = real_seg
|
160 |
# get unique RGB colors from this segmentation map
|
161 |
+
st.image(Image.fromarray(real_seg), width=512)
|
162 |
+
print(real_seg.shape)
|
163 |
unique_colors = np.unique(real_seg.reshape(-1, real_seg.shape[2]), axis=0)
|
164 |
st.session_state['unique_colors'] = unique_colors
|
165 |
# multiselect to choose multiple colors
|