Jerry Yan commited on
Commit
4067422
1 Parent(s): 276d5b4

update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -2,8 +2,20 @@ import os
2
  import sys
3
  import gradio as gr
4
 
5
- def greet(name):
6
- return "Hello " + name + "!!"
 
 
7
 
8
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
9
  iface.launch()
 
2
  import sys
3
  import gradio as gr
4
 
5
+ os.system('git clone https://github.com/Rudrabha/Wav2Lip.git')
6
+ os.system('pip install -r ./Wav2Lip/requirements.txt')
7
+ os.system('curl -o ./Wav2Lip/face_detection/detection/sfd/s3fd.pth https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth')
8
+ os.system('mv ./Wav2Lip/* .')
9
 
10
+ title = "Wav2Lip Huggingface Interface Test"
11
+ description = "A simple demo for Wav2Lip Official Repo"
12
+ article = "Official Repo: https://github.com/Rudrabha/Wav2Lip"
13
+
14
+ def inference(face, audio):
15
+ os.system("python inference.py --checkpoint_path ./wav2lip.pth --face {} --audio {}".format(face, audio))
16
+
17
+ return "./results/result_voice.mp4"
18
+
19
+
20
+ 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)
21
  iface.launch()