File size: 1,030 Bytes
0e921d4
 
 
 
4067422
 
 
0e921d4
4067422
 
 
 
 
 
 
 
 
 
 
0e921d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import sys
import gradio as gr

os.system('git clone https://github.com/Rudrabha/Wav2Lip.git')
os.system('curl -o ./Wav2Lip/face_detection/detection/sfd/s3fd.pth https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth')
os.system('mv ./Wav2Lip/* .')

title = "Wav2Lip Huggingface Interface Test"
description = "A simple demo for Wav2Lip Official Repo"
article = "Official Repo: https://github.com/Rudrabha/Wav2Lip"

def inference(face, audio):
    os.system("python inference.py --checkpoint_path ./wav2lip.pth --face {} --audio {}".format(face, audio))

    return "./results/result_voice.mp4"


iface = gr.Interface(inference, inputs=[gr.inputs.Video(type="mp4", source="upload", label="Talking Face Video (in mp4 format)", optional=False), gr.inputs.Audio(source="upload", type="filepath", label="Audio", optional=False)], outputs=["video"], title=title, description=description, article=article, examples=[["./examples/w2l_test_f1.mp4", "./examples/w2l_test_a1.wav"]], enable_queue=True)
iface.launch()