Update inference.py
Browse files- inference.py +1 -16
inference.py
CHANGED
|
@@ -282,7 +282,7 @@ class InferenceEngine(object):
|
|
| 282 |
save_video(video_tensor, audio_path, output_path, self.fps)
|
| 283 |
print(f'The generated video has been saved at {output_path}.')
|
| 284 |
|
| 285 |
-
|
| 286 |
self,
|
| 287 |
reference_image_path, audio_path, kps_path,
|
| 288 |
output_path,
|
|
@@ -299,19 +299,4 @@ class InferenceEngine(object):
|
|
| 299 |
reference_attention_weight, audio_attention_weight)
|
| 300 |
video_tensor = self.get_video_tensor(video_latents)
|
| 301 |
|
| 302 |
-
self.save_video_tensor(video_tensor, audio_path, output_path)
|
| 303 |
-
"""
|
| 304 |
-
|
| 305 |
-
def infer(self, reference_image_path, audio_path, kps_path, output_path, retarget_strategy, reference_attention_weight, audio_attention_weight):
|
| 306 |
-
reference_image, reference_image_for_kps, reference_kps = self.get_reference_image_for_kps(reference_image_path)
|
| 307 |
-
audio_waveform, video_length = self.get_waveform_video_length(audio_path)
|
| 308 |
-
kps_sequence = self.get_kps_sequence(kps_path, reference_kps, video_length, retarget_strategy)
|
| 309 |
-
kps_images = self.get_kps_images(kps_sequence, reference_image_for_kps, video_length)
|
| 310 |
-
|
| 311 |
-
video_latents = self.get_video_latents(
|
| 312 |
-
reference_image, kps_images, audio_waveform,
|
| 313 |
-
video_length,
|
| 314 |
-
reference_attention_weight, audio_attention_weight)
|
| 315 |
-
video_tensor = self.get_video_tensor(video_latents)
|
| 316 |
-
|
| 317 |
self.save_video_tensor(video_tensor, audio_path, output_path)
|
|
|
|
| 282 |
save_video(video_tensor, audio_path, output_path, self.fps)
|
| 283 |
print(f'The generated video has been saved at {output_path}.')
|
| 284 |
|
| 285 |
+
def infer(
|
| 286 |
self,
|
| 287 |
reference_image_path, audio_path, kps_path,
|
| 288 |
output_path,
|
|
|
|
| 299 |
reference_attention_weight, audio_attention_weight)
|
| 300 |
video_tensor = self.get_video_tensor(video_latents)
|
| 301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
self.save_video_tensor(video_tensor, audio_path, output_path)
|