goldpulpy's picture
Update app.py
4444c69
raw
history blame
541 Bytes
import random
import subprocess
import gradio as gr
def predict(video, audio):
try:
output_file = f"result/{random.randint(10,100000)}.mp4"
command = ["python", "inference.py", "--face", video,
"--audio", audio, "--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()