capstonedubtrack
commited on
Commit
•
142f986
1
Parent(s):
17fab46
Create app.py
Browse files
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 = "Automatic translation and dubbbing for Indic Languages"
|
10 |
+
description = "A demo application to dub and translate videos spoken in Tamil, Hindi, Bengali and Telugu"
|
11 |
+
article = "Official Repo: https://github.com/Rudrabha/Wav2Lip"
|
12 |
+
|
13 |
+
def inference(face, audio):
|
14 |
+
os.system("python inference.py --checkpoint_path ./wav2lip_gan.pth --face {} --audio {}".format(face, audio))
|
15 |
+
|
16 |
+
return "./results/result_voice.mp4"
|
17 |
+
|
18 |
+
|
19 |
+
iface = gr.Interface(inference, inputs=[gr.inputs.Radio(["Tamil", "Hindi", "Bengali", "Telugu"], label = "Enter language to translate to"), gr.inputs.Radio(["Slow", "Fast"], label = "Enter speaking speed"), gr.inputs.Radio(["Male", "Female"], label = "Enter preferred voice"), gr.inputs.Video(type="mp4", source="upload", label="Video to be Translated", optional=False)], outputs=["video"], title=title, description=description, article=article, enable_queue=True)
|
20 |
+
iface.launch()
|