Spaces:
Paused
Paused
import random | |
import subprocess | |
import os | |
import gradio | |
import gradio as gr | |
current_dir = os.path.dirname(os.path.abspath(__file__)) | |
def predict(video, audio): | |
print(f"Processing video {video} and audio {audio}") | |
output_file = f"{current_dir}/results/{random.randint(10,100000)}.mp4" | |
command = ["python", "inference.py", "--face", video, | |
"--audio", audio, "--outfile", output_file] | |
subprocess.run(command, check=True) | |
return gradio.File(output_file) | |
demo = gr.Interface(fn=predict, inputs=[gradio.Video(label='Source image/video'),gradio.Audio(type='filepath', label='Target Audio')], outputs=[gradio.File(type='binary',label='Output file')]) | |
demo.launch() | |