freealise commited on
Commit
8307ecb
1 Parent(s): 87d0890

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -338,8 +338,8 @@ def blur_image(image, depth, blur_data):
338
 
339
  return blur_frame
340
 
341
- def loadurl(url):
342
- return url, ""
343
 
344
 
345
  def select_frame(v, evt: gr.SelectData):
@@ -513,9 +513,9 @@ with gr.Blocks(css=css, js=js) as demo:
513
 
514
  with gr.Row():
515
  with gr.Column():
516
- input_url = gr.Textbox(elem_id="url", value="./examples/streetview.mp4", label="URL")
517
  input_video = gr.Video(label="Input Video", format="mp4")
518
- input_url.input(fn=loadurl, inputs=[input_url], outputs=[input_video, input_url])
519
  output_frame = gr.Gallery(label="Frames", preview=True, columns=8192, type="numpy")
520
  output_switch = gr.Checkbox(label="Show depths")
521
  output_switch.input(fn=switch_rows, inputs=[output_switch], outputs=[output_frame])
 
338
 
339
  return blur_frame
340
 
341
+ def loadfile(f):
342
+ return f, None
343
 
344
 
345
  def select_frame(v, evt: gr.SelectData):
 
513
 
514
  with gr.Row():
515
  with gr.Column():
516
+ input_file = gr.File(elem_id="file_in", file_types=['.mp4'], label="Video file in (.mp4)")
517
  input_video = gr.Video(label="Input Video", format="mp4")
518
+ input_file.change(fn=loadfile, inputs=[input_file], outputs=[input_video, input_file])
519
  output_frame = gr.Gallery(label="Frames", preview=True, columns=8192, type="numpy")
520
  output_switch = gr.Checkbox(label="Show depths")
521
  output_switch.input(fn=switch_rows, inputs=[output_switch], outputs=[output_frame])