Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -56,16 +56,10 @@ def generate_captions(image):
|
|
56 |
examples = [["test-1.jpg"], ["test-2.jpg"], ["test-3.jpg"], ["test-4.jpg"] , ["test-5.jpg"], ["test-6.jpg"], ["test-7.jpg"]]
|
57 |
outputs = [gr.outputs.Textbox(label="Caption generated by GIT-base"), gr.outputs.Textbox(label="Caption generated by GIT-large"), gr.outputs.Textbox(label="Caption generated by BLIP-base"), gr.outputs.Textbox(label="Caption generated by BLIP-large"), gr.outputs.Textbox(label="Caption generated by ViT+GPT-2")]
|
58 |
|
59 |
-
title = "Interactive demo: comparing image captioning models"
|
60 |
-
description = "Gradio Demo to compare GIT, BLIP and ViT+GPT2, 3 state-of-the-art vision+language models. To use it, simply upload your image and click 'submit', or click one of the examples to load them. Read more at the links below."
|
61 |
-
article = "<p style='text-align: center'><a href='https://huggingface.co/docs/transformers/main/model_doc/blip' target='_blank'>BLIP docs</a> | <a href='https://huggingface.co/docs/transformers/main/model_doc/git' target='_blank'>GIT docs</a></p>"
|
62 |
|
63 |
interface = gr.Interface(fn=generate_captions,
|
64 |
inputs=gr.inputs.Image(type="pil"),
|
65 |
outputs=outputs,
|
66 |
-
examples=examples,
|
67 |
-
title=title,
|
68 |
-
description=description,
|
69 |
-
article=article,
|
70 |
enable_queue=True)
|
71 |
interface.launch(debug=True)
|
|
|
56 |
examples = [["test-1.jpg"], ["test-2.jpg"], ["test-3.jpg"], ["test-4.jpg"] , ["test-5.jpg"], ["test-6.jpg"], ["test-7.jpg"]]
|
57 |
outputs = [gr.outputs.Textbox(label="Caption generated by GIT-base"), gr.outputs.Textbox(label="Caption generated by GIT-large"), gr.outputs.Textbox(label="Caption generated by BLIP-base"), gr.outputs.Textbox(label="Caption generated by BLIP-large"), gr.outputs.Textbox(label="Caption generated by ViT+GPT-2")]
|
58 |
|
|
|
|
|
|
|
59 |
|
60 |
interface = gr.Interface(fn=generate_captions,
|
61 |
inputs=gr.inputs.Image(type="pil"),
|
62 |
outputs=outputs,
|
63 |
+
examples=examples,
|
|
|
|
|
|
|
64 |
enable_queue=True)
|
65 |
interface.launch(debug=True)
|