Spaces:
Runtime error
Runtime error
v0.0.2.beta
Browse filesFiles changed (4)
24 unmodified lines25262728293099 unmodified lines13013113213313413513611 unmodified lines14814915015115215324 unmodified lines<a style='font-size:18px;color: #efefef' href='https://sadtalker.github.io'>Homepage</a> \<a style='font-size:18px;color: #efefef' href='https://github.com/Winfredy/SadTalker'> Github </div>")with gr.Row().style(equal_height=False):with gr.Column(variant='panel'):with gr.Tabs(elem_id="sadtalker_source_image"):99 unmodified linesenhancer],outputs=[gen_video],fn=sad_talker.test,cache_examples=False) # os.getenv('SYSTEM') == 'spaces')submit.click(fn=sad_talker.test,11 unmodified linesif __name__ == "__main__":demo = sadtalker_demo()demo.launch()24 unmodified lines25262728293031323334353699 unmodified lines13613713813914014114211 unmodified lines15415515615715815916024 unmodified lines<a style='font-size:18px;color: #efefef' href='https://sadtalker.github.io'>Homepage</a> \<a style='font-size:18px;color: #efefef' href='https://github.com/Winfredy/SadTalker'> Github </div>")gr.Markdown("""<b>You may duplicate the space and upgrade to GPU in settings for better performance and faster inference without waiting in the queue. <a style='display:inline-block' href="https://huggingface.co/spaces/vinthony/SadTalker?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a></b> \<br/><b>Alternatively, try our GitHub <a href=https://github.com/Winfredy/SadTalker> code </a> on your own GPU. </b> <a style='display:inline-block' href="https://github.com/Winfredy/SadTalker"><img src="https://img.shields.io/github/stars/Winfredy/SadTalker?style=social"/></a> \""")with gr.Row().style(equal_height=False):with gr.Column(variant='panel'):with gr.Tabs(elem_id="sadtalker_source_image"):99 unmodified linesenhancer],outputs=[gen_video],fn=sad_talker.test,cache_examples=os.getenv('SYSTEM') == 'spaces') #submit.click(fn=sad_talker.test,11 unmodified linesif __name__ == "__main__":demo = sadtalker_demo()demo.queue(max_size=10)demo.launch(debug=True)
12 unmodified lines1314151617181912 unmodified linesclass KeypointExtractor():def __init__(self, device):self.detector = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device='cpu')def extract_keypoint(self, images, name=None, info=True):if isinstance(images, list):12 unmodified lines1314151617181912 unmodified linesclass KeypointExtractor():def __init__(self, device):self.detector = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device=device)def extract_keypoint(self, images, name=None, info=True):if isinstance(images, list):
41 unmodified lines424344454647484925 unmodified lines75767778798036 unmodified lines11711811912012112212341 unmodified linesself.free_view_checkpoint = os.path.join( checkpoint_path, 'facevid2vid_00189-model.pth.tar')self.lazy_load = lazy_loadif not self.lazy_load:25 unmodified linesself.mapping_checkpoint = os.path.join(self.checkpoint_path, 'mapping_00229-model.pth.tar')self.facerender_yaml_path = os.path.join(self.config_path, 'facerender.yaml')print(self.free_view_checkpoint)self.animate_from_coeff = AnimateFromCoeff(self.free_view_checkpoint, self.mapping_checkpoint,self.facerender_yaml_path, self.device)36 unmodified linesbatch = get_data(first_coeff_path, audio_path, self.device, ref_eyeblink_coeff_path=None, still=still_mode) # longer audio?coeff_path = self.audio_to_coeff.generate(batch, save_dir, pose_style)#coeff2videobatch_size = 2data = get_facerender_data(coeff_path, crop_pic_path, first_coeff_path, audio_path, batch_size, still_mode=still_mode, preprocess=preprocess)return_path = self.animate_from_coeff.generate(data, save_dir, pic_path, crop_info, enhancer='gfpgan' if use_enhancer else None, preprocess=preprocess)video_name = data['video_name']41 unmodified lines42434445464725 unmodified lines7374757677787936 unmodified lines11611711811912012112241 unmodified linesself.free_view_checkpoint = os.path.join( checkpoint_path, 'facevid2vid_00189-model.pth.tar')self.lazy_load = lazy_loadif not self.lazy_load:25 unmodified linesself.mapping_checkpoint = os.path.join(self.checkpoint_path, 'mapping_00229-model.pth.tar')self.facerender_yaml_path = os.path.join(self.config_path, 'facerender.yaml')print(self.mapping_checkpoint)print(self.free_view_checkpoint)self.animate_from_coeff = AnimateFromCoeff(self.free_view_checkpoint, self.mapping_checkpoint,self.facerender_yaml_path, self.device)36 unmodified linesbatch = get_data(first_coeff_path, audio_path, self.device, ref_eyeblink_coeff_path=None, still=still_mode) # longer audio?coeff_path = self.audio_to_coeff.generate(batch, save_dir, pose_style)#coeff2videobatch_size = 8data = get_facerender_data(coeff_path, crop_pic_path, first_coeff_path, audio_path, batch_size, still_mode=still_mode, preprocess=preprocess)return_path = self.animate_from_coeff.generate(data, save_dir, pic_path, crop_info, enhancer='gfpgan' if use_enhancer else None, preprocess=preprocess)video_name = data['video_name']
app.py+9-2
src/face3d/__pycache__/extract_kp_videos.cpython-38.pyc
src/face3d/extract_kp_videos.py+1-1
src/gradio_demo.py+2-3