VidiQA / app.py
ginipick's picture
Update app.py
19b56bd verified
# Importing the requirements
import warnings
warnings.filterwarnings("ignore")
import gradio as gr
from src.app.response import describe_video
# Video and text inputs for the interface
video = gr.Video(label="Video")
query = gr.Textbox(label="Question", placeholder="Enter your question here")
# Output for the interface
response = gr.Textbox(label="Predicted answer", show_label=True, show_copy_button=True)
# Examples for the interface
examples = [
[
"./videos/sample_video_1.mp4",
"Here are some frames of a video. Describe this video in detail.",
],
[
"./videos/sample_video_2.mp4",
"¿Cuál es el animal de este vídeo? ¿Cuantos animales hay?",
],
["./videos/sample_video_3.mp4", "이 비디오를 설명하라"],
]
css = """
footer {
visibility: hidden;
}
"""
# Launch the interface
interface = gr.Interface(css=css,
fn=describe_video,
inputs=[video, query],
outputs=response,
examples=examples,
theme="Nymbo/Nymbo_Theme",
allow_flagging="never",
)
interface.launch(debug=False)