huzey commited on
Commit
5c1d3a1
1 Parent(s): 40e33a1
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -173,6 +173,7 @@ def run_fn(
173
  min_dist=0.1,
174
  ):
175
  if images is None:
 
176
  return [], "No images selected."
177
 
178
  kwargs = {
@@ -248,20 +249,13 @@ with gr.Blocks() as demo:
248
  logging_text = gr.Textbox("Logging information", label="Logging", elem_id="logging", type="text", placeholder="Logging information")
249
 
250
  def load_default_images():
251
- return default_images, default_outputs, example_items
252
 
253
  def empty_input_and_output():
254
- return [], [], example_items
255
 
256
- def hide_example_gallery(images):
257
- if images is None:
258
- return
259
-
260
- # hide the example gallery, use css to hide
261
-
262
-
263
- load_images_button.click(load_default_images, outputs=[input_gallery, output_gallery, example_gallery])
264
- clear_images_button.click(empty_input_and_output, outputs=[input_gallery, output_gallery, example_gallery])
265
  submit_button.click(
266
  run_fn,
267
  inputs=[
 
173
  min_dist=0.1,
174
  ):
175
  if images is None:
176
+ gr.Warning("No images selected.")
177
  return [], "No images selected."
178
 
179
  kwargs = {
 
249
  logging_text = gr.Textbox("Logging information", label="Logging", elem_id="logging", type="text", placeholder="Logging information")
250
 
251
  def load_default_images():
252
+ return default_images, default_outputs
253
 
254
  def empty_input_and_output():
255
+ return [], []
256
 
257
+ load_images_button.click(load_default_images, outputs=[input_gallery, output_gallery])
258
+ clear_images_button.click(empty_input_and_output, outputs=[input_gallery, output_gallery])
 
 
 
 
 
 
 
259
  submit_button.click(
260
  run_fn,
261
  inputs=[