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()