gina9726 commited on
Commit
6a327ff
1 Parent(s): a72d6d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -9
app.py CHANGED
@@ -1,24 +1,31 @@
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()
 
1
  import gradio as gr
2
 
3
  examples = [
4
+ ["forest", "https://ak.picdn.net/shutterstock/videos/21179416/preview/stock-footage-aerial-shot-winter-forest.mp4"],
5
+ ["people", "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
+ ["orange", "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, labels
11
 
12
  with gr.Blocks() as demo:
13
+ gr.Markdown(
14
+ """
15
+ # Ego-VPA Demo
16
+ Choose a sample video and click predict to view the results.
17
+ """
18
+ )
19
  with gr.Row():
20
  with gr.Column():
21
+ video = gr.PlayableVideo(label="video", interactive=False)
22
  with gr.Column():
23
+ labels = gr.Text(label="Ground Truth")
24
+ zeroshot = gr.Text(label="LaViLa (zero-shot) prediction")
25
+ ours = gr.Text(label="Ego-VPA prediction")
26
  btn = gr.Button("Predict", variant="primary")
27
+ btn.click(predict, inputs=[labels, video], outputs=[zeroshot, ours])
28
+ gr.Examples(examples=examples, inputs=[labels, video])
29
 
30
  if __name__ == "__main__":
31
  demo.launch()