Run below command to train the model.
We provide sample audios in ./demo/input.
sh scripts/demo.sh multi
To use wav2vec of facebook/wav2vec2-large-xlsr-53, please move to /path/to/conda_environment/lib/python3.8/site-packages/transformers/models/wav2vec2/processing_wav2vec2.py and change the code as below.
L105: tokenizer = Wav2Vec2CTCTokenizer.from_pretrained(pretrained_model_name_or_path, **kwargs)
to
L105: tokenizer=Wav2Vec2CTCTokenizer.from_pretrained("facebook/wav2vec2-base-960h",**kwargs)
sh scripts/train_multi.sh MultiTalk_s1 config/multi/stage1.yaml multi s1
Training for Speech-Driven Motion Synthesis
Make sure the paths of pre-trained models are correct, i.e.,vqvae_pretrained_path and wav2vec2model_path in config/multi/stage2.yaml.
sh scripts/train_multi.sh MultiTalk_s2 config/multi/stage2.yaml multi s2
Testing
Lip Vertex Error (LVE)
For evaluating the lip vertex error, please run below command.
sh scripts/test.sh MultiTalk_s2 config/multi/stage2.yaml vocaset s2
Audio-Visual Lip Reading (AVLR)
For evaluating lip readability with a pre-trained Audio-Visual Speech Recognition (AVSR), download language specific checkpoint, dictionary, and tokenizer from muavic.
Place them in ./avlr/${language}/checkpoints/${language}_avlr.
Although our codebase allows for training with multi-GPUs, we did not test it and just hardcode the training batch size as one. You may need to change the data_loader if needed.
Acknowledgement
We heavily borrow the code from
Codetalk.
We sincerely appreciate those authors.