BertChristiaens commited on
Commit
e74357b
1 Parent(s): 61a9d1f

multiselect

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -161,12 +161,12 @@ def make_editing_canvas(canvas_color, brush, _reset_state, generation_mode, pain
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
  print(unique_colors)
165
- unique_colors = (tuple(color) for color in unique_colors)
166
  st.session_state['unique_colors'] = unique_colors
167
  # multiselect to choose multiple colors
168
  chosen_colors = st.multiselect(
169
- "Choose colors", list(unique_colors), key='unique_colors'
170
  )
171
  print(chosen_colors)
172
 
 
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
+ unique_colors = [tuple(color) for color in unique_colors]
165
  print(unique_colors)
 
166
  st.session_state['unique_colors'] = unique_colors
167
  # multiselect to choose multiple colors
168
  chosen_colors = st.multiselect(
169
+ label="Choose colors", options=unique_colors, default=None, key='unique_colors'
170
  )
171
  print(chosen_colors)
172