huzey commited on
Commit
5f0daa6
1 Parent(s): c9c808c

update cluster UI

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -1099,11 +1099,9 @@ def make_parameters_section(is_lisa=False):
1099
  negative_prompt = gr.Textbox(label="Prompt (Negative)", elem_id="prompt", placeholder="e.g. 'a photo from egocentric view'", visible=False)
1100
  node_type_dropdown = gr.Dropdown(layer_names, label="LISA (SAM) decoder: Layer and Node", value="dec_1_block", elem_id="node_type")
1101
  else:
1102
- # remove LISA from the list
1103
  model_radio = gr.Radio(["CLIP", "DiNO", "Diffusion", "ImageNet", "MAE", "SAM"], label="Backbone", value="DiNO", elem_id="model_radio", show_label=True)
1104
  model_dropdown = gr.Dropdown(get_filtered_model_names("DiNO"), label="", value="DiNO(dino_vitb8_448)", elem_id="model_name", show_label=False)
1105
  model_radio.change(fn=lambda x: gr.update(choices=get_filtered_model_names(x), value=get_default_model_name(x)), inputs=model_radio, outputs=[model_dropdown])
1106
- # model_radio.change(fn=lambda x: gr.update(value=get_filtered_model_names(x)[0]), inputs=model_radio, outputs=[model_dropdown])
1107
  layer_slider = gr.Slider(1, 12, step=1, label="Backbone: Layer index", value=10, elem_id="layer")
1108
  positive_prompt = gr.Textbox(label="Prompt (Positive)", elem_id="prompt", placeholder="e.g. 'a photo of Gibson Les Pual guitar'")
1109
  positive_prompt.visible = False
@@ -1180,7 +1178,7 @@ with demo:
1180
 
1181
  with gr.Column(scale=5, min_width=200):
1182
  output_gallery = make_output_images_section()
1183
- cluster_gallery = gr.Gallery(value=[], label="Clusters", show_label=False, elem_id="clusters", columns=[2], rows=[1], object_fit="contain", height=300, show_share_button=True, preview=True, interactive=False)
1184
  [
1185
  model_dropdown, layer_slider, node_type_dropdown, num_eig_slider,
1186
  affinity_focal_gamma_slider, num_sample_ncut_slider, knn_ncut_slider,
 
1099
  negative_prompt = gr.Textbox(label="Prompt (Negative)", elem_id="prompt", placeholder="e.g. 'a photo from egocentric view'", visible=False)
1100
  node_type_dropdown = gr.Dropdown(layer_names, label="LISA (SAM) decoder: Layer and Node", value="dec_1_block", elem_id="node_type")
1101
  else:
 
1102
  model_radio = gr.Radio(["CLIP", "DiNO", "Diffusion", "ImageNet", "MAE", "SAM"], label="Backbone", value="DiNO", elem_id="model_radio", show_label=True)
1103
  model_dropdown = gr.Dropdown(get_filtered_model_names("DiNO"), label="", value="DiNO(dino_vitb8_448)", elem_id="model_name", show_label=False)
1104
  model_radio.change(fn=lambda x: gr.update(choices=get_filtered_model_names(x), value=get_default_model_name(x)), inputs=model_radio, outputs=[model_dropdown])
 
1105
  layer_slider = gr.Slider(1, 12, step=1, label="Backbone: Layer index", value=10, elem_id="layer")
1106
  positive_prompt = gr.Textbox(label="Prompt (Positive)", elem_id="prompt", placeholder="e.g. 'a photo of Gibson Les Pual guitar'")
1107
  positive_prompt.visible = False
 
1178
 
1179
  with gr.Column(scale=5, min_width=200):
1180
  output_gallery = make_output_images_section()
1181
+ cluster_gallery = gr.Gallery(value=[], label="Clusters", show_label=False, elem_id="clusters", columns=[5], rows=[2], object_fit="contain", height="auto", show_share_button=True, preview=True, interactive=False)
1182
  [
1183
  model_dropdown, layer_slider, node_type_dropdown, num_eig_slider,
1184
  affinity_focal_gamma_slider, num_sample_ncut_slider, knn_ncut_slider,