Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ examples = [
|
|
11 |
"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",
|
12 |
"https://ak.picdn.net/shutterstock/videos/1063125190/preview/stock-footage-a-beautiful-cookie-with-oranges-lies-on-a-green-tablecloth.mp4"
|
13 |
]
|
14 |
-
|
15 |
#iface = gr.Interface(video_identity,
|
16 |
# gr.Video(),
|
17 |
# "playable_video",
|
@@ -19,4 +19,21 @@ iface = gr.PlayableVideo(examples[0])
|
|
19 |
# cache_examples=True)
|
20 |
|
21 |
#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
22 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
"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",
|
12 |
"https://ak.picdn.net/shutterstock/videos/1063125190/preview/stock-footage-a-beautiful-cookie-with-oranges-lies-on-a-green-tablecloth.mp4"
|
13 |
]
|
14 |
+
|
15 |
#iface = gr.Interface(video_identity,
|
16 |
# gr.Video(),
|
17 |
# "playable_video",
|
|
|
19 |
# cache_examples=True)
|
20 |
|
21 |
#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
22 |
+
#iface.launch()
|
23 |
+
|
24 |
+
def predict(video):
|
25 |
+
return "This is a test!", "0.75, 0.25"
|
26 |
+
|
27 |
+
with gr.Blocks() as demo:
|
28 |
+
with gr.Row():
|
29 |
+
with gr.Column():
|
30 |
+
seed = gr.PlayableVideo(examples[0], label="video")
|
31 |
+
with gr.Column():
|
32 |
+
pred = gr.Text(label="prediction")
|
33 |
+
prob = gr.Text(label="probability")
|
34 |
+
btn = gr.Button("Predict")
|
35 |
+
btn.click(predict, inputs=[seed], outputs=[pred, prob])
|
36 |
+
#gr.Examples(, inputs=[seed])
|
37 |
+
|
38 |
+
if __name__ == "__main__":
|
39 |
+
demo.launch()
|