paj commited on
Commit
02e4239
·
1 Parent(s): d42ae2f
Files changed (3) hide show
  1. app.py +20 -0
  2. packages.txt +1 -0
  3. requirements.txt +8 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ import gradio as gr
4
+
5
+ os.system('git clone https://github.com/Rudrabha/Wav2Lip.git')
6
+ os.system('curl -o ./Wav2Lip/face_detection/detection/sfd/s3fd.pth https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth')
7
+ os.system('mv ./Wav2Lip/* .')
8
+
9
+ title = "Wav2Lip Huggingface Interface Test"
10
+ description = "A simple demo for Wav2Lip Official Repo"
11
+ article = "Official Repo: https://github.com/Rudrabha/Wav2Lip"
12
+
13
+ def inference(face, audio):
14
+ os.system("python inference.py --checkpoint_path ./wav2lip.pth --face {} --audio {}".format(face, audio))
15
+
16
+ return "./results/result_voice.mp4"
17
+
18
+
19
+ 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=False)
20
+ iface.launch()
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ ffmpeg
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ librosa==0.7.0
2
+ numpy>=1.17.3
3
+ torch==1.4.0
4
+ torchvision==0.5.0
5
+ tqdm>=4.45.0
6
+ numba==0.48
7
+ opencv-contrib-python-headless==4.1.2.30
8
+