Spaces:
Runtime error
Runtime error
Update modules/sadtalker_test.py
Browse files6 unmodified lines78910111212 unmodified lines252627282930313228 unmodified lines6162636465666738 unmodified lines1061071081091101116 unmodified linesfrom src.facerender.animate import AnimateFromCoefffrom src.generate_batch import get_datafrom src.generate_facerender_batch import get_facerender_datafrom pydub import AudioSegment12 unmodified lineselse:device = "cpu"current_code_path = sys.argv[0]modules_path = os.path.split(current_code_path)[0]current_root_path = './'28 unmodified linesdef test(self, source_image, driven_audio, still_mode, use_enhancer, result_dir='./'):time_tag = strftime("%Y_%m_%d_%H.%M.%S")save_dir = os.path.join(result_dir, time_tag)os.makedirs(save_dir, exist_ok=True)38 unmodified linestorch.cuda.empty_cache()torch.cuda.synchronize()import gc; gc.collect()if use_enhancer:6 unmodified lines7891011121312 unmodified lines262728293031323328 unmodified lines6263646566676838 unmodified lines1071081091101111121136 unmodified linesfrom src.facerender.animate import AnimateFromCoefffrom src.generate_batch import get_datafrom src.generate_facerender_batch import get_facerender_dataimport uuidfrom pydub import AudioSegment12 unmodified lineselse:device = "cpu"# current_code_path = sys.argv[0]# modules_path = os.path.split(current_code_path)[0]current_root_path = './'28 unmodified linesdef test(self, source_image, driven_audio, still_mode, use_enhancer, result_dir='./'):time_tag = str(uuid.uuid4()) # strftime("%Y_%m_%d_%H.%M.%S")save_dir = os.path.join(result_dir, time_tag)os.makedirs(save_dir, exist_ok=True)38 unmodified linestorch.cuda.empty_cache()torch.cuda.synchronize()import gc; gc.collect()if use_enhancer:
modules/sadtalker_test.py+5-3