aiqtech commited on
Commit
9183e4b
โ€ข
1 Parent(s): 7a9cd45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -383,6 +383,22 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
383
  trial_id = gr.Textbox(visible=False)
384
  output_buf = gr.State()
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  def load_example(evt: gr.SelectData):
387
  selected_image = Image.open(example_images[evt.index])
388
  trial_id_val, processed_image = preprocess_image(selected_image)
@@ -465,22 +481,6 @@ if __name__ == "__main__":
465
  except Exception as e:
466
  print(f"Warning: Initial preprocessing test failed: {e}")
467
 
468
- # Examples ๊ฐค๋Ÿฌ๋ฆฌ ์„ค์ •
469
- if example_images:
470
- gr.Markdown("""### Example Images""")
471
- with gr.Row():
472
- gallery = gr.Gallery(
473
- value=example_images,
474
- label="Click an image to use it",
475
- show_label=True,
476
- elem_id="gallery",
477
- columns=12, # ํ•œ ์ค„์— 12๊ฐœ
478
- rows=2, # 2์ค„
479
- height=300, # ๋†’์ด ์กฐ์ •
480
- allow_preview=True,
481
- object_fit="contain" # ์ด๋ฏธ์ง€ ๋น„์œจ ์œ ์ง€
482
- )
483
-
484
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
485
  demo.queue() # ํ ๊ธฐ๋Šฅ ํ™œ์„ฑํ™”
486
  demo.launch(
 
383
  trial_id = gr.Textbox(visible=False)
384
  output_buf = gr.State()
385
 
386
+ # Examples ๊ฐค๋Ÿฌ๋ฆฌ๋ฅผ ๋งจ ์•„๋ž˜๋กœ ์ด๋™
387
+ if example_images:
388
+ gr.Markdown("""### Example Images""")
389
+ with gr.Row():
390
+ gallery = gr.Gallery(
391
+ value=example_images,
392
+ label="Click an image to use it",
393
+ show_label=True,
394
+ elem_id="gallery",
395
+ columns=12, # ํ•œ ์ค„์— 12๊ฐœ
396
+ rows=2, # 2์ค„
397
+ height=300, # ๋†’์ด ์กฐ์ •
398
+ allow_preview=True,
399
+ object_fit="contain" # ์ด๋ฏธ์ง€ ๋น„์œจ ์œ ์ง€
400
+ )
401
+
402
  def load_example(evt: gr.SelectData):
403
  selected_image = Image.open(example_images[evt.index])
404
  trial_id_val, processed_image = preprocess_image(selected_image)
 
481
  except Exception as e:
482
  print(f"Warning: Initial preprocessing test failed: {e}")
483
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
485
  demo.queue() # ํ ๊ธฐ๋Šฅ ํ™œ์„ฑํ™”
486
  demo.launch(