capstonedubtrack's picture
Update app.py
674fe8f
raw
history blame
1.17 kB
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 = "Automatic translation and dubbing for Indic Languages"
description = "A demo application to dub and translate videos spoken in Tamil, Hindi, Bengali and Telugu"
article = "Official Repo: https://github.com/Rudrabha/Wav2Lip"
def inference(face, audio):
os.system("python inference.py --checkpoint_path ./wav2lip_gan.pth --face {} --audio {}".format(face, audio))
return "./results/result_voice.mp4"
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)
iface.launch()