Update app.py
Browse files
app.py
CHANGED
@@ -98,8 +98,6 @@ def create_video(frames, fps, type):
|
|
98 |
|
99 |
|
100 |
def infer(f_in, interpolation, fps_output):
|
101 |
-
|
102 |
-
fps_output = logscale(fps_output)
|
103 |
# 1. break video into frames and get FPS
|
104 |
#break_vid = get_frames(url_in, "vid_input_frame", "origin", resize_n)
|
105 |
frames_list = f_in #break_vid[0]
|
@@ -343,31 +341,15 @@ with gr.Blocks() as demo:
|
|
343 |
files_orig.upload(fn=loadf, inputs=[files_orig, r_bg, mh, ms, md, lm, b_size, d_size], outputs=[files_input, gallery_input])
|
344 |
|
345 |
with gr.Row():
|
346 |
-
interpolation_slider = gr.Slider(minimum=1, maximum=
|
347 |
-
interpolation = gr.Number(value=1, show_label=False, interactive=False)
|
348 |
-
interpolation_slider.change(fn=logscale, inputs=[interpolation_slider], outputs=[interpolation])
|
349 |
with gr.Row():
|
350 |
-
fps_output_slider = gr.Slider(minimum=0, maximum=
|
351 |
-
fps_output = gr.Number(value=1, show_label=False, interactive=False)
|
352 |
-
fps_output_slider.change(fn=logscale, inputs=[fps_output_slider], outputs=[fps_output])
|
353 |
submit_btn = gr.Button("Submit")
|
354 |
|
355 |
with gr.Column():
|
356 |
video_output = gr.Video()
|
357 |
file_output = gr.File()
|
358 |
|
359 |
-
gr.Examples(
|
360 |
-
examples=[[
|
361 |
-
["./examples/0.png", "./examples/1.png", "./examples/2.png", "./examples/3.png", "./examples/4.png"], False, 0, 0, 0, "slider", 1, 1
|
362 |
-
], [
|
363 |
-
["./examples/0_flash.jpg", "./examples/1_noflash.jpg", "./examples/2_flash.jpg", "./examples/3_noflash.jpg"], True, 180, 255, 12, "slider", 3, 15
|
364 |
-
]],
|
365 |
-
fn=loadf,
|
366 |
-
inputs=[files_orig, r_bg, mh, ms, md, lm, b_size, d_size],
|
367 |
-
outputs=[files_input, gallery_input],
|
368 |
-
cache_examples=True
|
369 |
-
)
|
370 |
-
|
371 |
submit_btn.click(fn=infer, inputs=[files_input, interpolation_slider, fps_output_slider], outputs=[video_output, file_output])
|
372 |
|
373 |
demo.launch()
|
|
|
98 |
|
99 |
|
100 |
def infer(f_in, interpolation, fps_output):
|
|
|
|
|
101 |
# 1. break video into frames and get FPS
|
102 |
#break_vid = get_frames(url_in, "vid_input_frame", "origin", resize_n)
|
103 |
frames_list = f_in #break_vid[0]
|
|
|
341 |
files_orig.upload(fn=loadf, inputs=[files_orig, r_bg, mh, ms, md, lm, b_size, d_size], outputs=[files_input, gallery_input])
|
342 |
|
343 |
with gr.Row():
|
344 |
+
interpolation_slider = gr.Slider(minimum=1, maximum=24, step=1, value=1, label="Interpolation Steps: ")
|
|
|
|
|
345 |
with gr.Row():
|
346 |
+
fps_output_slider = gr.Slider(minimum=0, maximum=24, step=1, value=24, label="FPS output: ")
|
|
|
|
|
347 |
submit_btn = gr.Button("Submit")
|
348 |
|
349 |
with gr.Column():
|
350 |
video_output = gr.Video()
|
351 |
file_output = gr.File()
|
352 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
submit_btn.click(fn=infer, inputs=[files_input, interpolation_slider, fps_output_slider], outputs=[video_output, file_output])
|
354 |
|
355 |
demo.launch()
|