Spaces:
Running
Running
init image
Browse files
app.py
CHANGED
|
@@ -142,7 +142,7 @@ with demo:
|
|
| 142 |
with gr.Row():
|
| 143 |
submit_video_button = gr.Button('Submit')
|
| 144 |
with gr.Column():
|
| 145 |
-
|
| 146 |
with gr.Row():
|
| 147 |
example_videos = gr.Dataset(components=[input_video], samples=[['./videos/hitting_baseball.mp4'], ['./videos/hoverboarding.mp4'], ['./videos/yoga.mp4']])
|
| 148 |
|
|
@@ -155,7 +155,7 @@ with demo:
|
|
| 155 |
with gr.Row():
|
| 156 |
submit_image_button = gr.Button('Submit')
|
| 157 |
with gr.Column():
|
| 158 |
-
|
| 159 |
with gr.Row():
|
| 160 |
example_images = gr.Dataset(components=[input_image], samples=[['./images/cat.png'], ['./images/dog.png'], ['./images/panda.png']])
|
| 161 |
|
|
@@ -165,9 +165,9 @@ with demo:
|
|
| 165 |
"""
|
| 166 |
)
|
| 167 |
|
| 168 |
-
submit_video_button.click(fn=inference_video, inputs=input_video, outputs=
|
| 169 |
example_videos.click(fn=set_example_video, inputs=example_videos, outputs=example_videos.components)
|
| 170 |
-
submit_image_button.click(fn=inference_image, inputs=input_image, outputs=
|
| 171 |
example_images.click(fn=set_example_image, inputs=example_images, outputs=example_images.components)
|
| 172 |
|
| 173 |
demo.launch(enable_queue=True)
|
|
|
|
| 142 |
with gr.Row():
|
| 143 |
submit_video_button = gr.Button('Submit')
|
| 144 |
with gr.Column():
|
| 145 |
+
label_video = gr.Label(num_top_classes=5)
|
| 146 |
with gr.Row():
|
| 147 |
example_videos = gr.Dataset(components=[input_video], samples=[['./videos/hitting_baseball.mp4'], ['./videos/hoverboarding.mp4'], ['./videos/yoga.mp4']])
|
| 148 |
|
|
|
|
| 155 |
with gr.Row():
|
| 156 |
submit_image_button = gr.Button('Submit')
|
| 157 |
with gr.Column():
|
| 158 |
+
label_image = gr.Label(num_top_classes=5)
|
| 159 |
with gr.Row():
|
| 160 |
example_images = gr.Dataset(components=[input_image], samples=[['./images/cat.png'], ['./images/dog.png'], ['./images/panda.png']])
|
| 161 |
|
|
|
|
| 165 |
"""
|
| 166 |
)
|
| 167 |
|
| 168 |
+
submit_video_button.click(fn=inference_video, inputs=input_video, outputs=label_video)
|
| 169 |
example_videos.click(fn=set_example_video, inputs=example_videos, outputs=example_videos.components)
|
| 170 |
+
submit_image_button.click(fn=inference_image, inputs=input_image, outputs=label_image)
|
| 171 |
example_images.click(fn=set_example_image, inputs=example_images, outputs=example_images.components)
|
| 172 |
|
| 173 |
demo.launch(enable_queue=True)
|