Update app.py
Browse files
app.py
CHANGED
@@ -106,10 +106,10 @@ def get_frames(video_in):
|
|
106 |
return frames, fps
|
107 |
|
108 |
|
109 |
-
def create_video(frames, fps):
|
110 |
print("building video result")
|
111 |
clip = ImageSequenceClip(frames, fps=fps)
|
112 |
-
clip.write_videofile("
|
113 |
|
114 |
return 'movie.mp4'
|
115 |
|
@@ -324,9 +324,9 @@ def infer(video_in, trim_value, prompt, background_prompt):
|
|
324 |
with_matte_result_frames.append(f"matte_result_img-{i}.jpg")
|
325 |
print("frame " + i + "/" + str(n_frame) + ": done;")
|
326 |
|
327 |
-
vid_bg = create_video(with_bg_result_frames, fps)
|
328 |
-
vid_green = create_video(with_green_result_frames, fps)
|
329 |
-
vid_matte = create_video(with_matte_result_frames, fps)
|
330 |
print("finished !")
|
331 |
|
332 |
return vid_bg, vid_green, vid_matte
|
|
|
106 |
return frames, fps
|
107 |
|
108 |
|
109 |
+
def create_video(frames, fps, type):
|
110 |
print("building video result")
|
111 |
clip = ImageSequenceClip(frames, fps=fps)
|
112 |
+
clip.write_videofile(f"video_{type}_result.mp4", fps=fps)
|
113 |
|
114 |
return 'movie.mp4'
|
115 |
|
|
|
324 |
with_matte_result_frames.append(f"matte_result_img-{i}.jpg")
|
325 |
print("frame " + i + "/" + str(n_frame) + ": done;")
|
326 |
|
327 |
+
vid_bg = create_video(with_bg_result_frames, fps, "bg")
|
328 |
+
vid_green = create_video(with_green_result_frames, fps, "greenscreen")
|
329 |
+
vid_matte = create_video(with_matte_result_frames, fps, "matte")
|
330 |
print("finished !")
|
331 |
|
332 |
return vid_bg, vid_green, vid_matte
|