Spaces:
Paused
Paused
Update app_parallel.py
Browse files- app_parallel.py +3 -3
app_parallel.py
CHANGED
@@ -115,7 +115,7 @@ def process_chunk(audio_chunk, preprocessed_data, args):
|
|
115 |
print("first_coeff_path",first_coeff_path)
|
116 |
print("crop_pic_path",crop_pic_path)
|
117 |
print("crop_info",crop_info)
|
118 |
-
|
119 |
batch = get_data(first_coeff_path, audio_chunk, args.device, ref_eyeblink_coeff_path=None, still=args.still)
|
120 |
audio_to_coeff = Audio2Coeff(audio2pose_checkpoint, audio2pose_yaml_path,
|
121 |
audio2exp_checkpoint, audio2exp_yaml_path,
|
@@ -129,7 +129,7 @@ def process_chunk(audio_chunk, preprocessed_data, args):
|
|
129 |
data = get_facerender_data(coeff_path, crop_pic_path, first_coeff_path, audio_chunk,
|
130 |
args.batch_size, args.input_yaw, args.input_pitch, args.input_roll,
|
131 |
expression_scale=args.expression_scale, still_mode=args.still, preprocess=args.preprocess)
|
132 |
-
|
133 |
print("Will Enter Animation")
|
134 |
result, base64_video, temp_file_path, _ = animate_from_coeff.generate(data, args.result_dir, args.source_image, crop_info,
|
135 |
enhancer=args.enhancer, background_enhancer=args.background_enhancer, preprocess=args.preprocess)
|
@@ -140,7 +140,7 @@ def process_chunk(audio_chunk, preprocessed_data, args):
|
|
140 |
app.config['temp_response'] = base64_video
|
141 |
app.config['final_video_path'] = temp_file_path
|
142 |
# app.config['final_video_duration'] = duration
|
143 |
-
|
144 |
return base64_video, temp_file_path
|
145 |
|
146 |
|
|
|
115 |
print("first_coeff_path",first_coeff_path)
|
116 |
print("crop_pic_path",crop_pic_path)
|
117 |
print("crop_info",crop_info)
|
118 |
+
torch.cuda.empty_cache()
|
119 |
batch = get_data(first_coeff_path, audio_chunk, args.device, ref_eyeblink_coeff_path=None, still=args.still)
|
120 |
audio_to_coeff = Audio2Coeff(audio2pose_checkpoint, audio2pose_yaml_path,
|
121 |
audio2exp_checkpoint, audio2exp_yaml_path,
|
|
|
129 |
data = get_facerender_data(coeff_path, crop_pic_path, first_coeff_path, audio_chunk,
|
130 |
args.batch_size, args.input_yaw, args.input_pitch, args.input_roll,
|
131 |
expression_scale=args.expression_scale, still_mode=args.still, preprocess=args.preprocess)
|
132 |
+
torch.cuda.empty_cache()
|
133 |
print("Will Enter Animation")
|
134 |
result, base64_video, temp_file_path, _ = animate_from_coeff.generate(data, args.result_dir, args.source_image, crop_info,
|
135 |
enhancer=args.enhancer, background_enhancer=args.background_enhancer, preprocess=args.preprocess)
|
|
|
140 |
app.config['temp_response'] = base64_video
|
141 |
app.config['final_video_path'] = temp_file_path
|
142 |
# app.config['final_video_duration'] = duration
|
143 |
+
torch.cuda.empty_cache()
|
144 |
return base64_video, temp_file_path
|
145 |
|
146 |
|