goldpulpy's picture
Update app.py
f1de88d
import random
import subprocess
import gradio as gr
def predict(video, audio):
video_path = video.name
audio_path = audio.name
try:
output_file = f"result/{random.randint(10,100000)}.mp4"
command = ["python", "inference.py", "--face", video_path,
"--audio", audio_path, "--outfile", output_file]
subprocess.run(command, check=True)
return output_file
except: pass
app = gr.Interface(predict,[gr.File(label='Source image/video'),gr.File(label='Target Audio')], gr.File(label="Out Video"))
if __name__ == "__main__":
app.launch()