PolarisFTL commited on
Commit
59ef994
·
verified ·
1 Parent(s): 5294810

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -19
app.py CHANGED
@@ -7,7 +7,7 @@ def predict(image):
7
  r_image = yolo.detect_image(image)
8
  return r_image
9
 
10
- title = "MASFNet: Multi-scale Adaptive Sampling Fusion Network for Object Detection in Adverse Weather"
11
  description = ""
12
  article = ""
13
 
@@ -15,35 +15,34 @@ def reset_interface():
15
  return gr.update(value=None), gr.update(visible=False)
16
 
17
  example_images = [
18
- "img/1.png",
19
- "img/2.png",
20
- "img/3.png",
21
- "img/4.png",
22
- "img/5.png",
23
- "img/6.png",
24
- "img/7.png",
25
- "img/8.png",
26
- "img/10.png",
27
  ]
28
 
29
  with gr.Blocks() as demo:
30
  gr.Markdown(f"### {title}")
31
  gr.Markdown(description)
32
-
33
  with gr.Row():
34
  with gr.Column():
35
  img_input = gr.Image(type="pil", label="Upload an Image")
36
  submit_btn = gr.Button("Submit")
37
  with gr.Column():
38
  output = gr.Image(type="pil", label="Prediction Result")
39
-
40
  submit_btn.click(fn=predict, inputs=img_input, outputs=output)
41
  demo.load(reset_interface, None, [output])
 
 
 
 
 
42
 
43
- with gr.Row():
44
- gr.Examples(
45
- examples=example_images,
46
- inputs=img_input,
47
- )
48
-
49
- demo.launch()
 
7
  r_image = yolo.detect_image(image)
8
  return r_image
9
 
10
+ title = "MASFNet: Multi-scale Adaptive Sampling Fusion Network for Object Detection in Adverse Weather "
11
  description = ""
12
  article = ""
13
 
 
15
  return gr.update(value=None), gr.update(visible=False)
16
 
17
  example_images = [
18
+ ["img/1.png"],
19
+ ["img/2.png"],
20
+ ["img/3.png"],
21
+ ["img/4.png"],
22
+ ["img/5.png"],
23
+ ["img/6.png"],
24
+ ["img/7.png"],
25
+ ["img/8.png"],
26
+ ["img/10.png"],
27
  ]
28
 
29
  with gr.Blocks() as demo:
30
  gr.Markdown(f"### {title}")
31
  gr.Markdown(description)
32
+
33
  with gr.Row():
34
  with gr.Column():
35
  img_input = gr.Image(type="pil", label="Upload an Image")
36
  submit_btn = gr.Button("Submit")
37
  with gr.Column():
38
  output = gr.Image(type="pil", label="Prediction Result")
39
+
40
  submit_btn.click(fn=predict, inputs=img_input, outputs=output)
41
  demo.load(reset_interface, None, [output])
42
+ gr.Examples(
43
+ examples=example_images,
44
+ inputs=img_input,
45
+ )
46
+
47
 
48
+ demo.launch(share=True)