Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ os.system("git clone https://github.com/google-research/frame-interpolation")
|
|
3 |
import sys
|
4 |
sys.path.append("frame-interpolation")
|
5 |
|
|
|
6 |
import cv2
|
7 |
import numpy as np
|
8 |
import tensorflow as tf
|
@@ -31,7 +32,7 @@ def do_interpolation(frame1, frame2, interpolation):
|
|
31 |
input_frames = [frame1, frame2]
|
32 |
frames = list(
|
33 |
util.interpolate_recursively_from_files(
|
34 |
-
input_frames, interpolation, interpolator))
|
35 |
|
36 |
#print(frames)
|
37 |
mediapy.write_video(f"{frame1}_to_{frame2}_out.mp4", frames, fps=25)
|
@@ -157,7 +158,7 @@ with gr.Blocks() as demo:
|
|
157 |
with gr.Column():
|
158 |
url_input = gr.Textbox(value="./examples/streetview.mp4", label="URL")
|
159 |
with gr.Row():
|
160 |
-
interpolation = gr.Slider(minimum=1, maximum=24, step=1, value=
|
161 |
fps_output = gr.Radio([1, 6, 12, 24, 25], label="FPS output", value=1)
|
162 |
submit_btn = gr.Button("Submit")
|
163 |
|
@@ -166,7 +167,7 @@ with gr.Blocks() as demo:
|
|
166 |
file_output = gr.File()
|
167 |
|
168 |
gr.Examples(
|
169 |
-
examples=[["./examples/streetview.mp4",
|
170 |
fn=infer,
|
171 |
inputs=[url_input,interpolation,fps_output],
|
172 |
outputs=[video_output,file_output],
|
|
|
3 |
import sys
|
4 |
sys.path.append("frame-interpolation")
|
5 |
|
6 |
+
import math
|
7 |
import cv2
|
8 |
import numpy as np
|
9 |
import tensorflow as tf
|
|
|
32 |
input_frames = [frame1, frame2]
|
33 |
frames = list(
|
34 |
util.interpolate_recursively_from_files(
|
35 |
+
input_frames, math.log2(interpolation), interpolator))
|
36 |
|
37 |
#print(frames)
|
38 |
mediapy.write_video(f"{frame1}_to_{frame2}_out.mp4", frames, fps=25)
|
|
|
158 |
with gr.Column():
|
159 |
url_input = gr.Textbox(value="./examples/streetview.mp4", label="URL")
|
160 |
with gr.Row():
|
161 |
+
interpolation = gr.Slider(minimum=1, maximum=24, step=1, value=5, label="Interpolation Steps")
|
162 |
fps_output = gr.Radio([1, 6, 12, 24, 25], label="FPS output", value=1)
|
163 |
submit_btn = gr.Button("Submit")
|
164 |
|
|
|
167 |
file_output = gr.File()
|
168 |
|
169 |
gr.Examples(
|
170 |
+
examples=[["./examples/streetview.mp4", 5, 1]],
|
171 |
fn=infer,
|
172 |
inputs=[url_input,interpolation,fps_output],
|
173 |
outputs=[video_output,file_output],
|