Update app.py
Browse files
app.py
CHANGED
@@ -89,14 +89,11 @@ def create_video(frames, fps, type):
|
|
89 |
return type + "_result.mp4"
|
90 |
|
91 |
|
92 |
-
def infer(url_in,
|
93 |
|
94 |
|
95 |
# 1. break video into frames and get FPS
|
96 |
-
|
97 |
-
break_vid = get_frames(video_in, "vid_input_frame", "origin")
|
98 |
-
else:
|
99 |
-
break_vid = get_frames(url_in, "vid_input_frame", "origin")
|
100 |
frames_list= break_vid[0]
|
101 |
fps = break_vid[1]
|
102 |
print(f"ORIGIN FPS: {fps}")
|
@@ -162,11 +159,10 @@ with gr.Blocks() as demo:
|
|
162 |
gr.HTML(title)
|
163 |
with gr.Row():
|
164 |
with gr.Column():
|
165 |
-
video_input = gr.Video(source="upload", type="filepath")
|
166 |
url_input = gr.Textbox(value="./examples/no_framerate.mp4")
|
167 |
with gr.Row():
|
168 |
-
interpolation = gr.Slider(minimum=1,maximum=
|
169 |
-
fps_output = gr.Radio([
|
170 |
submit_btn = gr.Button("Submit")
|
171 |
|
172 |
with gr.Column():
|
@@ -174,13 +170,13 @@ with gr.Blocks() as demo:
|
|
174 |
file_output = gr.File()
|
175 |
|
176 |
gr.Examples(
|
177 |
-
examples=[["./examples/no_framerate.mp4", 1,
|
178 |
fn=infer,
|
179 |
-
inputs=[url_input,
|
180 |
outputs=[video_output,file_output],
|
181 |
cache_examples=True
|
182 |
)
|
183 |
|
184 |
-
submit_btn.click(fn=infer, inputs=[url_input,
|
185 |
|
186 |
demo.launch()
|
|
|
89 |
return type + "_result.mp4"
|
90 |
|
91 |
|
92 |
+
def infer(url_in,interpolation,fps_output):
|
93 |
|
94 |
|
95 |
# 1. break video into frames and get FPS
|
96 |
+
break_vid = get_frames(url_in, "vid_input_frame", "origin")
|
|
|
|
|
|
|
97 |
frames_list= break_vid[0]
|
98 |
fps = break_vid[1]
|
99 |
print(f"ORIGIN FPS: {fps}")
|
|
|
159 |
gr.HTML(title)
|
160 |
with gr.Row():
|
161 |
with gr.Column():
|
|
|
162 |
url_input = gr.Textbox(value="./examples/no_framerate.mp4")
|
163 |
with gr.Row():
|
164 |
+
interpolation = gr.Slider(minimum=1, maximum=24, step=1, value=1, label="Interpolation Steps")
|
165 |
+
fps_output = gr.Radio([6, 12, 24, 25], label="FPS output", value=6)
|
166 |
submit_btn = gr.Button("Submit")
|
167 |
|
168 |
with gr.Column():
|
|
|
170 |
file_output = gr.File()
|
171 |
|
172 |
gr.Examples(
|
173 |
+
examples=[["./examples/no_framerate.mp4", 1, 6]],
|
174 |
fn=infer,
|
175 |
+
inputs=[url_input,interpolation,fps_output],
|
176 |
outputs=[video_output,file_output],
|
177 |
cache_examples=True
|
178 |
)
|
179 |
|
180 |
+
submit_btn.click(fn=infer, inputs=[url_input,interpolation,fps_output], outputs=[video_output, file_output])
|
181 |
|
182 |
demo.launch()
|