Spaces:
Sleeping
Sleeping
Update memo/utils/vision_utils.py
Browse files
memo/utils/vision_utils.py
CHANGED
@@ -35,8 +35,8 @@ def tensor_to_video(tensor, output_video_path, input_audio_path, fps=30):
|
|
35 |
final_duration = min(video_duration, audio_duration)
|
36 |
audio_clip = audio_clip.subclip(0, final_duration)
|
37 |
new_video_clip = VideoClip(make_frame, duration=final_duration)
|
38 |
-
new_video_clip = new_video_clip.set_audio(audio_clip)
|
39 |
-
|
40 |
|
41 |
@torch.no_grad()
|
42 |
def preprocess_image(face_analysis_model: str, image_path: str, image_size: int = 512):
|
|
|
35 |
final_duration = min(video_duration, audio_duration)
|
36 |
audio_clip = audio_clip.subclip(0, final_duration)
|
37 |
new_video_clip = VideoClip(make_frame, duration=final_duration)
|
38 |
+
new_video_clip = new_video_clip.set_audio(audio_clip)
|
39 |
+
new_video_clip.write_videofile(output_video_path, fps=fps, codec="libx264", audio_codec="aac")
|
40 |
|
41 |
@torch.no_grad()
|
42 |
def preprocess_image(face_analysis_model: str, image_path: str, image_size: int = 512):
|