saifhassan / Wav2Lip-HD

High-Fidelity Lip-Syncing with Wav2Lip and Real-ESRGAN
Other
320 stars 75 forks source link

Ability to pass multiple audio files to lip sync to multiple people in the video (enhancement) #19

Open Barnacules opened 10 months ago

Barnacules commented 10 months ago

I would like to request an option to add multiple .wav audio files to the command line parameters to be synced to different faces in the target video. For simplicity it could be each audio file is added in the order it's presented on the command line and the order that face appears in the target video.

Example Video shows a person talking, then cuts to another person talking (interview). The --audio parameter on the command line could be used multiple times and each audio file would be assigned to the face in the order it's detected in the target video.

Implementation Allow for muliple --audio parameters passed on the command line or one parameter with a semicolon delimited list of audio (.wav) files. Each file would be applied in the order a new face is detected in the target video. inference.py --audio 1.wav,2.wav,3.wav inference.py --audio 1.wav --audio 2.wav --audio 3.wav

I don't think the current project knows how to differentiate between different faces but rather only knows how to detect a face. If that is the case the code to do this could be borrowed from the (Roop) face swap project which has code in it that can detect a specific face throughout the course of an entire video and swap it. I haven't looked at the code yet, but it looks like it's usually similar libraries to what your project is using.