### Install DreamTalk environment and dependencies Source: https://github.com/ali-vilab/dreamtalk/blob/main/README.md Creates a Python 3.7 conda environment, installs requirements, PyTorch 1.8.0 with CUDA 11.1, updates ffmpeg, and pins urllib3, transformers, and dlib versions. ```bash conda create -n dreamtalk python=3.7.0 conda activate dreamtalk pip install -r requirements.txt conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge conda update ffmpeg pip install urllib3==1.26.6 pip install transformers==4.28.1 pip install dlib ``` -------------------------------- ### Run inference_for_demo_video.py with default settings Source: https://github.com/ali-vilab/dreamtalk/blob/main/README.md Runs the DreamTalk inference script with an audio file, style clip, pose, and portrait. The input audio can be wav, mp3, m4a, or mp4 (video with sound). The portrait should be larger than 256x256 and frontal for best results; it will be cropped to 256x256. The generated video is saved as $(output_name).mp4 in the output_video folder, with intermediate results in tmp/$(output_name). ```bash python inference_for_demo_video.py \ --wav_path data/audio/acknowledgement_english.m4a \ --style_clip_path data/style_clip/3DMM/M030_front_neutral_level1_001.mat \ --pose_path data/pose/RichardShelby_front_neutral_level1_001.mat \ --image_path data/src_img/uncropped/male_face.png \ --cfg_scale 1.0 \ --max_gen_len 30 \ --output_name acknowledgement_english@M030_front_neutral_level1_001@male_face ``` -------------------------------- ### Run inference_for_demo_video.py with --disable_img_crop Source: https://github.com/ali-vilab/dreamtalk/blob/main/README.md Runs the inference script with the --disable_img_crop flag to skip cropping the input portrait. Use this when the portrait is already cropped to 256x256. The input audio can be wav, mp3, m4a, or mp4 (video with sound). The generated video is saved as $(output_name).mp4 in the output_video folder. ```bash python inference_for_demo_video.py \ --wav_path data/audio/acknowledgement_chinese.m4a \ --style_clip_path data/style_clip/3DMM/M030_front_surprised_level3_001.mat \ --pose_path data/pose/RichardShelby_front_neutral_level1_001.mat \ --image_path data/src_img/cropped/zp1.png \ --disable_img_crop \ --cfg_scale 1.0 \ --max_gen_len 30 \ --output_name acknowledgement_chinese@M030_front_surprised_level3_001@zp1 ```