mirror of
https://github.com/TMElyralab/MuseTalk.git
synced 2026-02-05 18:09:19 +08:00
fix: use torch.no_grad() in inference to prevent excessive memory usage (~30GB) with inference (#349)
This commit is contained in:
@@ -235,6 +235,7 @@ class Avatar:
|
|||||||
cv2.imwrite(f"{self.avatar_path}/tmp/{str(self.idx).zfill(8)}.png", combine_frame)
|
cv2.imwrite(f"{self.avatar_path}/tmp/{str(self.idx).zfill(8)}.png", combine_frame)
|
||||||
self.idx = self.idx + 1
|
self.idx = self.idx + 1
|
||||||
|
|
||||||
|
@torch.no_grad()
|
||||||
def inference(self, audio_path, out_vid_name, fps, skip_save_images):
|
def inference(self, audio_path, out_vid_name, fps, skip_save_images):
|
||||||
os.makedirs(self.avatar_path + '/tmp', exist_ok=True)
|
os.makedirs(self.avatar_path + '/tmp', exist_ok=True)
|
||||||
print("start inference")
|
print("start inference")
|
||||||
|
|||||||
Reference in New Issue
Block a user