Commit
·
87b83c0
1
Parent(s):
fcd98ee
add labels to output?
Browse files
app.py
CHANGED
|
@@ -41,15 +41,17 @@ def blip2_interface(image, prompted_caption_text, vqa_question, chat_context):
|
|
| 41 |
|
| 42 |
return image_caption, prompted_caption, vqa_answer, chat_response
|
| 43 |
|
| 44 |
-
# Define Gradio input
|
| 45 |
-
image_input = gr.Image(type="numpy")
|
| 46 |
-
prompted_caption_input = gr.Textbox()
|
| 47 |
-
vqa_question_input = gr.Textbox()
|
| 48 |
-
chat_context = gr.Textbox()
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
# Create Gradio interface
|
| 55 |
iface = gr.Interface(
|
|
|
|
| 41 |
|
| 42 |
return image_caption, prompted_caption, vqa_answer, chat_response
|
| 43 |
|
| 44 |
+
# Define Gradio input components
|
| 45 |
+
image_input = gr.inputs.Image(type="numpy", label="Image Input")
|
| 46 |
+
prompted_caption_input = gr.inputs.Textbox(label="Prompted Caption Text")
|
| 47 |
+
vqa_question_input = gr.inputs.Textbox(label="VQA Question")
|
| 48 |
+
chat_context = gr.inputs.Textbox(label="Chat Context")
|
| 49 |
+
|
| 50 |
+
# Define Gradio output components with labels corresponding to the inputs
|
| 51 |
+
image_caption_result = gr.outputs.Textbox(label="Image Caption")
|
| 52 |
+
prompted_caption_result = gr.outputs.Textbox(label="Prompted Image Caption")
|
| 53 |
+
vqa_answer = gr.outputs.Textbox(label="VQA Answer")
|
| 54 |
+
chat_response = gr.outputs.Textbox(label="Chat Response")
|
| 55 |
|
| 56 |
# Create Gradio interface
|
| 57 |
iface = gr.Interface(
|