SadTalker Explained - How to set reference videos for eye blinking and head pose... Code included.

Аватар автора
Python истории
A number of people are confused about how to set the reference files for the SadTalker stable diffusion model so it can animate head movements and the eye blinking frequency when creating video. In this video we describe what needs to be done and how you can make the settings. The code is also included for reference. == Links! == Code to add into the gradio_demo.py file as reviewed in the video: current_directory = os.getcwd() print(current_directory) # Set the source directory source_dir = os.path.dirname(os.path.abspath(__file__)) ref_eyeblink = "C:\Users\yours\SadTalker\ref_eyeblink_video.mp4" print(ref_eyeblink) ref_pose = "C:\Users\yours\SadTalker\ref_pose_video.mp4" print(ref_pose) # Code snippet (continued) if ref_eyeblink is not None: ref_eyeblink_videoname = os.path.splitext(os.path.split(ref_eyeblink)[-1])[0] ref_eyeblink_frame_dir = os.path.join(save_dir, ref_eyeblink_videoname) os.makedirs(ref_eyeblink_frame_dir, exist_ok=True) print(&Extraction for the reference video providing eye blinking') ref_eyeblink_coeff_path, _, _ = self.preprocess_model.generate(ref_eyeblink, ref_eyeblink_frame_dir) else: ref_eyeblink_coeff_path = None # Code snippet (continued) if ref_pose is not None: if ref_pose == ref_eyeblink: ref_pose_coeff_path = ref_eyeblink_coeff_path...

0/0


0/0

0/0

0/0