gina9726 commited on
Commit
a72d6d6
1 Parent(s): 479deb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,24 +1,24 @@
1
  import gradio as gr
2
 
3
  examples = [
4
- ["test1", "https://ak.picdn.net/shutterstock/videos/21179416/preview/stock-footage-aerial-shot-winter-forest.mp4"],
5
- ["test2", "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"],
6
- ["test3", "https://ak.picdn.net/shutterstock/videos/1063125190/preview/stock-footage-a-beautiful-cookie-with-oranges-lies-on-a-green-tablecloth.mp4"]
7
  ]
8
 
9
- def predict(label, video):
10
- return label
11
 
12
  with gr.Blocks() as demo:
13
  with gr.Row():
14
  with gr.Column():
15
  video = gr.PlayableVideo(label="video")
16
  with gr.Column():
17
- label = gr.Text(label="ground truth")
18
  pred = gr.Text(label="prediction")
19
  btn = gr.Button("Predict", variant="primary")
20
- btn.click(predict, inputs=[label, video], outputs=[pred])
21
- gr.Examples(examples=examples, inputs=[label, video], cache_examples=True)
22
 
23
  if __name__ == "__main__":
24
  demo.launch()
 
1
  import gradio as gr
2
 
3
  examples = [
4
+ "https://ak.picdn.net/shutterstock/videos/21179416/preview/stock-footage-aerial-shot-winter-forest.mp4",
5
+ "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",
6
+ "https://ak.picdn.net/shutterstock/videos/1063125190/preview/stock-footage-a-beautiful-cookie-with-oranges-lies-on-a-green-tablecloth.mp4"
7
  ]
8
 
9
+ def predict(labels, video):
10
+ return labels
11
 
12
  with gr.Blocks() as demo:
13
  with gr.Row():
14
  with gr.Column():
15
  video = gr.PlayableVideo(label="video")
16
  with gr.Column():
17
+ labels = gr.Text(label="labels")
18
  pred = gr.Text(label="prediction")
19
  btn = gr.Button("Predict", variant="primary")
20
+ btn.click(predict, inputs=[labels, video], outputs=[pred])
21
+ gr.Examples(examples=examples, inputs=[video])
22
 
23
  if __name__ == "__main__":
24
  demo.launch()