prismer / app.py
shikunl's picture
Update structure
64fb58a
raw
history blame
789 Bytes
import gradio as gr
import torch
from gradio_caption import create_demo as create_caption
from gradio_vqa import create_demo as create_vqa
css = """
#img-display-input {
height: auto;
max-height: 40vh;
}
#img-display-output {
max-height: 40vh;
}
"""
description = """
# Prismer
The official demo for **Prismer: A Vision-Language Model with An Ensemble of Experts**.
Please refer to our [project page](https://shikun.io/projects/prismer) or [github](https://github.com/NVlabs/prismer) for more details.
"""
with gr.Blocks(css=css) as demo:
gr.Markdown(description)
with gr.Tab("Zero-shot Image Captioning"):
create_caption()
with gr.Tab("Visual Question Answering"):
create_vqa()
if __name__ == '__main__':
demo.queue().launch()