Update app.py
Browse files
app.py
CHANGED
@@ -87,10 +87,17 @@ def get_frames(video_in, step, name, resize_w):
|
|
87 |
|
88 |
def create_video(frames, fps, type):
|
89 |
print("building video result")
|
|
|
|
|
90 |
clip = ImageSequenceClip(frames, fps=fps)
|
91 |
-
clip.write_gif(type + "_result.gif", fps=fps)
|
92 |
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
|
96 |
def infer(url_in,interpolation,fps_output,resize_n,winsize,o_flow):
|
@@ -241,9 +248,9 @@ with gr.Blocks() as demo:
|
|
241 |
submit_btn = gr.Button("Submit")
|
242 |
|
243 |
with gr.Column():
|
244 |
-
video_output = gr.
|
245 |
file_output = gr.File()
|
246 |
-
depth_output = gr.
|
247 |
|
248 |
gr.Examples(
|
249 |
examples=[["./examples/streetview.mp4", 1, 0, 256, 15, True]],
|
|
|
87 |
|
88 |
def create_video(frames, fps, type):
|
89 |
print("building video result")
|
90 |
+
#https://zulko.github.io/moviepy/getting_started/videoclips.html#mask-clips
|
91 |
+
|
92 |
clip = ImageSequenceClip(frames, fps=fps)
|
|
|
93 |
|
94 |
+
maskclip = ImageSequenceClip(frames, fps=fps) #, ismask=True)
|
95 |
+
maskclip.to_mask()
|
96 |
+
clip.set_mask(maskclip)
|
97 |
+
|
98 |
+
clip.write_videofile(type + "_result.mp4", fps=fps)
|
99 |
+
|
100 |
+
return type + "_result.mp4"
|
101 |
|
102 |
|
103 |
def infer(url_in,interpolation,fps_output,resize_n,winsize,o_flow):
|
|
|
248 |
submit_btn = gr.Button("Submit")
|
249 |
|
250 |
with gr.Column():
|
251 |
+
video_output = gr.Video()
|
252 |
file_output = gr.File()
|
253 |
+
depth_output = gr.Video()
|
254 |
|
255 |
gr.Examples(
|
256 |
examples=[["./examples/streetview.mp4", 1, 0, 256, 15, True]],
|