minhdang commited on
Commit
d691aad
·
verified ·
1 Parent(s): a24e0ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -25
app.py CHANGED
@@ -146,32 +146,32 @@ def inference_image(img):
146
  return {imagenet_id_to_classname[str(i)]: float(prediction[i]) for i in range(1000)}
147
 
148
 
149
- # demo = gr.Interface(
150
- # fn = inference_video,
151
- # inputs = gr.Video(sources='webcam',),
152
- # outputs = "label",
153
 
154
  # )
155
- demo = gr.Blocks()
156
- with demo:
157
- gr.Markdown(
158
- """
159
- # VideoMamba-Ti
160
- Gradio demo for <a href='https://github.com/OpenGVLab/VideoMamba' target='_blank'>VideoMamba</a>: To use it, simply upload your video, or click one of the examples to load them. Read more at the links below.
161
- """
162
- )
163
-
164
- # with gr.Tab("Video"):
165
- # # with gr.Box():
166
- with gr.Row():
167
- with gr.Column():
168
- with gr.Row():
169
- input_video = gr.Video(label='Input Video', height=360)
170
- # input_video = load_video(input_video)
171
- with gr.Row():
172
- submit_video_button = gr.Button('Submit')
173
- with gr.Column():
174
- label_video = gr.Label(num_top_classes=5)
175
  # with gr.Row():
176
  # gr.Examples(examples=['./videos/hitting_baseball.mp4', './videos/hoverboarding.mp4', './videos/yoga.mp4'], inputs=input_video, outputs=label_video, fn=inference_video, cache_examples=True)
177
 
@@ -194,7 +194,7 @@ with demo:
194
  # """
195
  # )
196
 
197
- submit_video_button.click(fn=inference_video, inputs=input_video, outputs=label_video)
198
  # # submit_image_button.click(fn=inference_image, inputs=input_image, outputs=label_image)
199
 
200
  demo.launch()
 
146
  return {imagenet_id_to_classname[str(i)]: float(prediction[i]) for i in range(1000)}
147
 
148
 
149
+ demo = gr.Interface(
150
+ fn = ultra_inference_video,
151
+ inputs = ["video"],
152
+ outputs = "label",
153
 
154
  # )
155
+ # demo = gr.Blocks()
156
+ # with demo:
157
+ # gr.Markdown(
158
+ # """
159
+ # # VideoMamba-Ti
160
+ # Gradio demo for <a href='https://github.com/OpenGVLab/VideoMamba' target='_blank'>VideoMamba</a>: To use it, simply upload your video, or click one of the examples to load them. Read more at the links below.
161
+ # """
162
+ # )
163
+
164
+ # # with gr.Tab("Video"):
165
+ # # # with gr.Box():
166
+ # with gr.Row():
167
+ # with gr.Column():
168
+ # with gr.Row():
169
+ # input_video = gr.Video(label='Input Video', height=360)
170
+ # # input_video = load_video(input_video)
171
+ # with gr.Row():
172
+ # submit_video_button = gr.Button('Submit')
173
+ # with gr.Column():
174
+ # label_video = gr.Label(num_top_classes=5)
175
  # with gr.Row():
176
  # gr.Examples(examples=['./videos/hitting_baseball.mp4', './videos/hoverboarding.mp4', './videos/yoga.mp4'], inputs=input_video, outputs=label_video, fn=inference_video, cache_examples=True)
177
 
 
194
  # """
195
  # )
196
 
197
+ # submit_video_button.click(fn=inference_video, inputs=input_video, outputs=label_video)
198
  # # submit_image_button.click(fn=inference_image, inputs=input_image, outputs=label_image)
199
 
200
  demo.launch()