File size: 607 Bytes
b67dfdb
 
5d4ae22
b67dfdb
 
e9947e1
 
 
0172d0a
 
f1de88d
 
0172d0a
 
 
 
 
4444c69
46dea19
 
 
 
 
b67dfdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()