Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,5 +23,24 @@ def answer_question(image, text):
|
|
23 |
image = gr.inputs.Image(type="pil")
|
24 |
question = gr.inputs.Textbox(label="Question")
|
25 |
answer = gr.outputs.Textbox(label="Predicted answer")
|
26 |
-
examples = [["cats.jpg"
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
image = gr.inputs.Image(type="pil")
|
24 |
question = gr.inputs.Textbox(label="Question")
|
25 |
answer = gr.outputs.Textbox(label="Predicted answer")
|
26 |
+
examples = [["cats.jpg", "How many cats are there?"],
|
27 |
+
[
|
28 |
+
"https://s3.geograph.org.uk/geophotos/06/21/24/6212487_1cca7f3f_1024x1024.jpg",
|
29 |
+
"What is the color of the flower?",
|
30 |
+
],
|
31 |
+
[
|
32 |
+
"https://computing.ece.vt.edu/~harsh/visualAttention/ProjectWebpage/Figures/vqa_1.png",
|
33 |
+
"What is the mustache made of?",
|
34 |
+
],
|
35 |
+
[
|
36 |
+
"https://computing.ece.vt.edu/~harsh/visualAttention/ProjectWebpage/Figures/vqa_2.png",
|
37 |
+
"How many slices of pizza are there?",
|
38 |
+
],
|
39 |
+
[
|
40 |
+
"https://computing.ece.vt.edu/~harsh/visualAttention/ProjectWebpage/Figures/vqa_3.png",
|
41 |
+
"Does it appear to be rainy?",
|
42 |
+
],
|
43 |
+
]
|
44 |
+
|
45 |
+
interface = gr.Interface(fn=answer_question, inputs=[image, question], outputs=answer, examples=examples, enable_queue=True)
|
46 |
+
interface.launch(debug=True)
|