File size: 979 Bytes
84598ac
 
812b68c
a72d6d6
 
 
812b68c
1c3e1c7
a72d6d6
 
1c3e1c7
 
 
 
479deb5
1c3e1c7
a72d6d6
331c201
e7748f9
a72d6d6
 
1c3e1c7
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr

examples = [
    "https://ak.picdn.net/shutterstock/videos/21179416/preview/stock-footage-aerial-shot-winter-forest.mp4",
    "https://ak.picdn.net/shutterstock/videos/5629184/preview/stock-footage-senior-couple-looking-through-binoculars-on-sailboat-together-shot-on-red-epic-for-high-quality-k.mp4",
    "https://ak.picdn.net/shutterstock/videos/1063125190/preview/stock-footage-a-beautiful-cookie-with-oranges-lies-on-a-green-tablecloth.mp4"
]

def predict(labels, video):
    return labels

with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            video = gr.PlayableVideo(label="video")
        with gr.Column():
            labels = gr.Text(label="labels")
            pred = gr.Text(label="prediction")            
    btn = gr.Button("Predict", variant="primary")
    btn.click(predict, inputs=[labels, video], outputs=[pred])
    gr.Examples(examples=examples, inputs=[video])

if __name__ == "__main__":
    demo.launch()