Update src/facerender/animate.py
Browse files
src/facerender/animate.py
CHANGED
|
@@ -240,7 +240,7 @@ class AnimateFromCoeff():
|
|
| 240 |
video_name_full = x['video_name'] + '_full.mp4'
|
| 241 |
full_video_path = os.path.join(video_save_dir, video_name_full)
|
| 242 |
return_path = full_video_path
|
| 243 |
-
paste_pic(path, pic_path, crop_info, new_audio_path, full_video_path, extended_crop= True if 'ext' in preprocess.lower() else False)
|
| 244 |
print(f'The generated video is named {video_save_dir}/{video_name_full}')
|
| 245 |
else:
|
| 246 |
full_video_path = av_path
|
|
@@ -255,15 +255,15 @@ class AnimateFromCoeff():
|
|
| 255 |
# print('return_path',return_path)
|
| 256 |
|
| 257 |
try:
|
| 258 |
-
enhanced_images_gen_with_len = enhancer_generator_with_len(
|
| 259 |
imageio.mimsave(enhanced_path, enhanced_images_gen_with_len, fps=float(25))
|
| 260 |
except:
|
| 261 |
-
enhanced_images_gen_with_len = enhancer_list(
|
| 262 |
imageio.mimsave(enhanced_path, enhanced_images_gen_with_len, fps=float(25))
|
| 263 |
|
| 264 |
-
print('enhanced_images_gen_with_len',enhanced_images_gen_with_len)
|
| 265 |
-
print('enhanced_path',enhanced_path)
|
| 266 |
-
print('av_path_enhancer',av_path_enhancer)
|
| 267 |
base64_video, temp_file_path = save_video_with_watermark(enhanced_path, new_audio_path, av_path_enhancer, watermark= False)
|
| 268 |
print(f'The generated video is named {video_save_dir}/{video_name_enhancer}')
|
| 269 |
os.remove(enhanced_path)
|
|
|
|
| 240 |
video_name_full = x['video_name'] + '_full.mp4'
|
| 241 |
full_video_path = os.path.join(video_save_dir, video_name_full)
|
| 242 |
return_path = full_video_path
|
| 243 |
+
base64_video, temp_file_path = paste_pic(path, pic_path, crop_info, new_audio_path, full_video_path, extended_crop= True if 'ext' in preprocess.lower() else False)
|
| 244 |
print(f'The generated video is named {video_save_dir}/{video_name_full}')
|
| 245 |
else:
|
| 246 |
full_video_path = av_path
|
|
|
|
| 255 |
# print('return_path',return_path)
|
| 256 |
|
| 257 |
try:
|
| 258 |
+
enhanced_images_gen_with_len = enhancer_generator_with_len(temp_file_path, method=enhancer, bg_upsampler=background_enhancer)
|
| 259 |
imageio.mimsave(enhanced_path, enhanced_images_gen_with_len, fps=float(25))
|
| 260 |
except:
|
| 261 |
+
enhanced_images_gen_with_len = enhancer_list(temp_file_path, method=enhancer, bg_upsampler=background_enhancer)
|
| 262 |
imageio.mimsave(enhanced_path, enhanced_images_gen_with_len, fps=float(25))
|
| 263 |
|
| 264 |
+
# print('enhanced_images_gen_with_len',enhanced_images_gen_with_len)
|
| 265 |
+
# print('enhanced_path',enhanced_path)
|
| 266 |
+
# print('av_path_enhancer',av_path_enhancer)
|
| 267 |
base64_video, temp_file_path = save_video_with_watermark(enhanced_path, new_audio_path, av_path_enhancer, watermark= False)
|
| 268 |
print(f'The generated video is named {video_save_dir}/{video_name_enhancer}')
|
| 269 |
os.remove(enhanced_path)
|