ilass commited on
Commit
8571969
·
1 Parent(s): 6eec5f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -31,23 +31,23 @@ def detect(img):
31
  with gr.Blocks() as demo:
32
 
33
  with gr.Tab("Upload"):
34
- gr.Markdown("# foodServed, drinkServed, person, V0.0.5") # Dieser Text wird am Anfang des Tabs angezeigt.
35
 
36
  # Pfad zu Ihren Demo-Bildern
37
- # demo_images = ["demoImages/demo01.jpg", "demoImages/demo02.jpg", "demoImages/demo03.jpg"]
38
- # demo_images = ["demo01.jpg", "demo02.jpg", "demo03.jpg"]
39
- demo_images = ["demo01.jpg"]
40
 
41
- input_img = gr.Image(type='pil', examples=demo_images) # 'examples' Parameter hinzufügen
 
42
 
43
  button = gr.Button("Detect",variant="primary")
 
44
 
45
- gr.Markdown("## Output")
46
- out_img = gr.Image(type='pil')
 
 
47
 
48
- button.click(detect,
49
- inputs=input_img,
50
- outputs=out_img)
51
 
52
  with gr.Tab("Url"):
53
  default_url = 'https://t7.baidu.com/it/u=3601447414,1764260638&fm=193&f=GIF'
 
31
  with gr.Blocks() as demo:
32
 
33
  with gr.Tab("Upload"):
34
+ gr.Markdown("# foodServed, drinkServed, person, V0.0.6") # Dieser Text wird am Anfang des Tabs angezeigt.
35
 
36
  # Pfad zu Ihren Demo-Bildern
37
+ demo_images = ["demoImages/demo01.jpg", "demoImages/demo02.jpg", "demoImages/demo03.jpg"]
 
 
38
 
39
+ input_img = gr.Image(type='pil')
40
+ out_img = gr.Image(type='pil')
41
 
42
  button = gr.Button("Detect",variant="primary")
43
+ button.click(detect,inputs=input_img, outputs=out_img)
44
 
45
+ gr.Examples(examples=[[img] for img in demo_images],
46
+ inputs=[input_img],
47
+ outputs=[out_img],
48
+ fn=detect)
49
 
50
+ gr.Markdown("## Output")
 
 
51
 
52
  with gr.Tab("Url"):
53
  default_url = 'https://t7.baidu.com/it/u=3601447414,1764260638&fm=193&f=GIF'