PolarisFTL commited on
Commit
2d99e0c
·
verified ·
1 Parent(s): 1969532

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -18
app.py CHANGED
@@ -8,21 +8,23 @@ def predict(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
-
14
- gr.Interface(
15
- fn=predict,
16
- inputs=[
17
- gr.Image(type="pil", label="Upload an Image"),
18
- gr.Button("Submit")
19
- ],
20
- outputs=gr.Image(type="pil", label="Prediction Result"),
21
- title=title,
22
- description=description,
23
- article=article,
24
- examples=[
25
- ["img/1.png"],
26
- ["img/2.png"]
27
- ]
28
- ).launch()
 
 
 
8
  return r_image
9
 
10
  title = "MASFNet: Multi-scale Adaptive Sampling Fusion Network for Object Detection in Adverse Weather"
11
+ description = """
12
+ The bot was trained to answer questions based on Rick and Morty dialogues. Ask Rick anything!
13
+ <img src="https://huggingface.co/spaces/course-demos/Rick_and_Morty_QA/resolve/main/rick.png" width=200px>
14
+ """
15
+
16
+ article = "Check out [the original Rick and Morty Bot](https://huggingface.co/spaces/kingabzpro/Rick_and_Morty_Bot) that this demo is based off of."
17
+
18
+ def reset_interface():
19
+ return gr.update(value=None), gr.update(visible=False)
20
+
21
+ with gr.Blocks() as demo:
22
+ img_input = gr.Image(type="pil", label="Upload an Image")
23
+ submit_btn = gr.Button("Submit")
24
+ output = gr.Image(type="pil", label="Prediction Result")
25
+
26
+ submit_btn.click(fn=predict, inputs=img_input, outputs=output)
27
+
28
+ demo.load(reset_interface, None, [output])
29
+
30
+ demo.launch()