Seokju Cho commited on
Commit
f0e61c5
1 Parent(s): 6bb4f34

fix submit button

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -274,6 +274,12 @@ def track(
274
  return video_file_path
275
 
276
 
 
 
 
 
 
 
277
  with gr.Blocks() as demo:
278
  video = gr.State()
279
  video_queried_preview = gr.State()
@@ -317,7 +323,7 @@ with gr.Blocks() as demo:
317
  inputs=[video_in],
318
  examples_per_page=3
319
  )
320
- submit = gr.Button("Submit", scale=0)
321
 
322
 
323
  gr.Markdown("## Second step: Add query points to the video, and click track.")
@@ -349,6 +355,12 @@ with gr.Blocks() as demo:
349
  autoplay=True,
350
  loop=True,
351
  )
 
 
 
 
 
 
352
 
353
  submit.click(
354
  fn = preprocess_video_input,
 
274
  return video_file_path
275
 
276
 
277
+ def video_input_fn(video_path):
278
+ if video_path is None:
279
+ return gr.update(interactive=False)
280
+ return gr.update(interactive=True)
281
+
282
+
283
  with gr.Blocks() as demo:
284
  video = gr.State()
285
  video_queried_preview = gr.State()
 
323
  inputs=[video_in],
324
  examples_per_page=3
325
  )
326
+ submit = gr.Button("Submit", interactive=False, scale=0)
327
 
328
 
329
  gr.Markdown("## Second step: Add query points to the video, and click track.")
 
355
  autoplay=True,
356
  loop=True,
357
  )
358
+
359
+ video_in.change(
360
+ fn = video_input_fn,
361
+ inputs = [video_in],
362
+ outputs = [submit],
363
+ )
364
 
365
  submit.click(
366
  fn = preprocess_video_input,