lime-j commited on
Commit
752e4db
·
verified ·
1 Parent(s): 567cfbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -144,18 +144,18 @@ with gr.Blocks() as block_demo:
144
  gr.Button(interactive=False),
145
  # gr.Markdown(f'Left image: {method_dict[method1]}'),
146
  # gr.Markdown(f'Right image: {method_dict[method2]}'),
147
- gr.Button(visible=True, interactive=True),
148
  # gr.Image(new_image1),
149
  # gr.Image(new_image2),
150
  # f'### Submit your choice for **{new_property}**'
151
  ]
152
 
153
- l_butt.click(fn=update_interface, inputs=[method1_state, image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt])
154
- r_butt.click(fn=update_interface, inputs=[method2_state, image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt])
155
- both_good.click(fn=update_interface, inputs=[gr.State('both_good'), image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt])
156
- both_bad.click(fn=update_interface, inputs=[gr.State('both_bad'), image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt])
157
 
158
 
159
- refresh_butt.click(None, js="window.location.reload()")
160
 
161
  block_demo.launch()
 
144
  gr.Button(interactive=False),
145
  # gr.Markdown(f'Left image: {method_dict[method1]}'),
146
  # gr.Markdown(f'Right image: {method_dict[method2]}'),
147
+ gr.Button(visible=False, interactive=True),
148
  # gr.Image(new_image1),
149
  # gr.Image(new_image2),
150
  # f'### Submit your choice for **{new_property}**'
151
  ]
152
 
153
+ l_butt.click(fn=update_interface, inputs=[method1_state, image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt], js="window.location.reload()")
154
+ r_butt.click(fn=update_interface, inputs=[method2_state, image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt],js="window.location.reload()")
155
+ both_good.click(fn=update_interface, inputs=[gr.State('both_good'), image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt],js="window.location.reload()")
156
+ both_bad.click(fn=update_interface, inputs=[gr.State('both_bad'), image_state, method1_state, method2_state, property_state, ip_state], outputs=[l_butt, r_butt, both_good, both_bad, refresh_butt], js="window.location.reload()")
157
 
158
 
159
+ # refresh_butt.click(None, js="window.location.reload()")
160
 
161
  block_demo.launch()