This repository contains code for lip synchronization using Wav2Lip, a deep learning-based model.
git clone https://github.com/Dishantkharkar/LipSync-Wav2Lip-Project.git
cd LipSync-Wav2Lip-Project
pip install -r requirements.txt
Download the pretrained model from s3fd.pth and save it in the face_detection/detection/sfd/
folder.
Navigate to the official Wav2Lip repository and follow the instructions in the README to obtain additional weights.
Place your video and audio files in the folder shown below:
Run the following command to perform lip synchronization:
python inference.py --checkpoint_path <path_to_pretrained_model> --face <path_to_face_video> --audio <path_to_audio_file>
Replace <path_to_pretrained_model>
, <path_to_face_video>
, and <path_to_audio_file>
with the appropriate paths.
Example using newscript.txt
file:
The result will be stored in the Result
folder with the name result_audio
.
For evaluating the model, you can use the provided evaluation script:
python evaluation/evaluate.py --model_path <path_to_model> --data_path <path_to_evaluation_data>
Replace <path_to_model>
and <path_to_evaluation_data>
with the paths to your trained model and evaluation dataset, respectively.
For more details and updates, refer to the original Wav2Lip README.