Spaces:
Runtime error
Runtime error
File size: 1,372 Bytes
edee3e1 3c7e204 3c9d15d edee3e1 1622a2c edee3e1 1622a2c edee3e1 1622a2c f232938 edee3e1 61e578b c32bad9 d622542 56847bb b5bf9e1 bfafe88 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import os
os.system("pip install gradio==2.7.5.2")
os.system("python -m pip install paddlepaddle-gpu==2.2.1.post112 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html")
os.system("hub install wav2lip==1.0.0")
import gradio as gr
import paddlehub as hub
module = hub.Module(name="wav2lip")
def inference(image,audio):
module.wav2lip_transfer(face=image, audio=audio, output_dir='.', use_gpu=False)
return "result.mp4"
title = "Wav2lip"
description = "Gradio demo for Wav2lip: Accurately Lip-syncing Videos In The Wild. To use it, simply upload your image and audio file, or click one of the examples to load them. Read more at the links below. Please trim audio file to maximum of 3-4 seconds"
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2008.10010' target='_blank'>A Lip Sync Expert Is All You Need for Speech to Lip Generation In The Wild</a> | <a href='https://github.com/PaddlePaddle/PaddleGAN/blob/develop/docs/en_US/tutorials/wav2lip.md' target='_blank'>Github Repo</a></p>"
examples=[['monatest.jpeg',"game.wav"]]
iface = gr.Interface(inference, [gr.inputs.Image(type="filepath"),gr.inputs.Audio(source="microphone", type="filepath")],
outputs=gr.outputs.Video(label="Output Video"),examples=examples,title=title,article=article,description=description)
iface.launch(cache_examples=True,enable_queue=True) |