Downloads · 30 days
0
kylielee505/mywav2liphd
mywav2liphd is a machine learning model from kylielee505. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains code for achieving high-fidelity lip-syncing in videos, using the Wav2Lip algorithm for lip-syncing and the Real-ESRGAN algorithm for super-resolution. The combination of these two algorithms…
Downloads · 30 days
0
Access
Public
Updated Dec 23, 2024
Repo size
1.1 GB
Likes
0
Public
Click a slice to open those files.
.pth713 MB · 61%
From the Hugging Face model README
This repository contains code for achieving high-fidelity lip-syncing in videos, using the Wav2Lip algorithm for lip-syncing and the Real-ESRGAN algorithm for super-resolution. The combination of these two algorithms allows for the creation of lip-synced videos that are both highly accurate and visually stunning.
The algorithm for achieving high-fidelity lip-syncing with Wav2Lip and Real-ESRGAN can be summarized as follows:
Wav2Lip algorithm.To test the "Wav2Lip-HD" model, follow these steps:
Clone this repository and install requirements using following command (Make sure, Python and CUDA are already installed):
git clone https://github.com/saifhassan/Wav2Lip-HD.git
cd Wav2Lip-HD
pip install -r requirements.txt
Downloading weights
| Model | Directory | Download Link |
|---|---|---|
| Wav2Lip | checkpoints/ | Link |
| ESRGAN | experiments/001_ESRGAN_x4_f64b23_custom16k_500k_B16G1_wandb/models/ | Link |
| Face_Detection | face_detection/detection/sfd/ | Link |
| Real-ESRGAN | Real-ESRGAN/gfpgan/weights/ | Link |
| Real-ESRGAN | Real-ESRGAN/weights/ | Link |
Put input video to input_videos directory and input audio to input_audios directory.
Open run_final.sh file and modify following parameters:
filename=kennedy (just video file name without extension)
input_audio=input_audios/ai.wav (audio filename with extension)
Execute run_final.sh using following command:
bash run_final.sh
Outputs
output_videos_wav2lip directory contains video output generated by wav2lip algorithm.frames_wav2lip directory contains frames extracted from video (generated by wav2lip algorithm).frames_hd directory contains frames after performing super-resolution using Real-ESRGAN algorithm.output_videos_hd directory contains final high quality video output generated by Wav2Lip-HD.The results produced by Wav2Lip-HD are in two forms, one is frames and other is videos. Both are shared below:
| Video by Wav2Lip | Optimized Video |
|---|---|
| <video src="https://user-images.githubusercontent.com/11873763/229389410-56d96244-8c67-4add-a43e-a4900aa9db88.mp4" width="500"> | <video src="https://user-images.githubusercontent.com/11873763/229389414-d5cb6d33-7772-47a7-b829-9e3d5c3945a1.mp4" width="500"> |
| <video src="https://user-images.githubusercontent.com/11873763/229389751-507669f1-7772-4863-ab23-8df7f206a065.mp4" width="500"> | <video src="https://user-images.githubusercontent.com/11873763/229389962-5373b765-ce3a-4af2-bd6a-8be8543ee933.mp4" width="500"> |
We would like to thank the following repositories and libraries for their contributions to our work: