Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
examples = [
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
]
|
8 |
|
9 |
-
def predict(
|
10 |
-
return
|
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 |
-
|
18 |
pred = gr.Text(label="prediction")
|
19 |
btn = gr.Button("Predict", variant="primary")
|
20 |
-
btn.click(predict, inputs=[
|
21 |
-
gr.Examples(examples=examples, inputs=[
|
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()
|