SkalskiP commited on
Commit
c803a91
1 Parent(s): 25b18cc

Florence-2 + SAM2 video demo fix

Browse files
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -169,7 +169,7 @@ def process_image(
169
  @torch.inference_mode()
170
  @torch.autocast(device_type="cuda", dtype=torch.bfloat16)
171
  def process_video(
172
- mode_dropdown, video_input, text_input, progress=gr.Progress(track_tqdm=True)
173
  ) -> Optional[str]:
174
  if not video_input:
175
  gr.Info("Please upload a video.")
@@ -333,18 +333,17 @@ with gr.Blocks() as demo:
333
  with gr.Column():
334
  video_processing_video_output_component = gr.Video(
335
  label='Video output')
336
- with gr.Row():
337
- gr.Examples(
338
- fn=process_video,
339
- examples=VIDEO_PROCESSING_EXAMPLES,
340
- inputs=[
341
- video_processing_mode_dropdown_component,
342
- video_processing_video_input_component,
343
- video_processing_text_input_component
344
- ],
345
- outputs=video_processing_video_output_component,
346
- run_on_click=True
347
- )
348
 
349
  image_processing_submit_button_component.click(
350
  fn=process_image,
@@ -381,7 +380,6 @@ with gr.Blocks() as demo:
381
  video_processing_submit_button_component.click(
382
  fn=process_video,
383
  inputs=[
384
- video_processing_mode_dropdown_component,
385
  video_processing_video_input_component,
386
  video_processing_text_input_component
387
  ],
@@ -390,7 +388,6 @@ with gr.Blocks() as demo:
390
  video_processing_text_input_component.submit(
391
  fn=process_video,
392
  inputs=[
393
- video_processing_mode_dropdown_component,
394
  video_processing_video_input_component,
395
  video_processing_text_input_component
396
  ],
 
169
  @torch.inference_mode()
170
  @torch.autocast(device_type="cuda", dtype=torch.bfloat16)
171
  def process_video(
172
+ video_input, text_input, progress=gr.Progress(track_tqdm=True)
173
  ) -> Optional[str]:
174
  if not video_input:
175
  gr.Info("Please upload a video.")
 
333
  with gr.Column():
334
  video_processing_video_output_component = gr.Video(
335
  label='Video output')
336
+ with gr.Row():
337
+ gr.Examples(
338
+ fn=process_video,
339
+ examples=VIDEO_PROCESSING_EXAMPLES,
340
+ inputs=[
341
+ video_processing_video_input_component,
342
+ video_processing_text_input_component
343
+ ],
344
+ outputs=video_processing_video_output_component,
345
+ run_on_click=True
346
+ )
 
347
 
348
  image_processing_submit_button_component.click(
349
  fn=process_image,
 
380
  video_processing_submit_button_component.click(
381
  fn=process_video,
382
  inputs=[
 
383
  video_processing_video_input_component,
384
  video_processing_text_input_component
385
  ],
 
388
  video_processing_text_input_component.submit(
389
  fn=process_video,
390
  inputs=[
 
391
  video_processing_video_input_component,
392
  video_processing_text_input_component
393
  ],