Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -8,18 +8,17 @@ import requests
|
|
8 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
9 |
|
10 |
def predict(video, audio):
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
demo.launch()
|
25 |
|
|
|
8 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
9 |
|
10 |
def predict(video, audio):
|
11 |
+
try:
|
12 |
+
print(f"Processing video {video} and audio {audio}")
|
13 |
+
output_file = f"result/{random.randint(10,100000)}.mp4"
|
14 |
+
command = ["python", "inference.py", "--face", video,
|
15 |
+
"--audio", audio, "--outfile", output_file]
|
16 |
+
subprocess.run(command, check=True)
|
17 |
+
print(f"{output_file}")
|
18 |
+
return output_file
|
19 |
+
except: pass
|
20 |
+
|
21 |
+
|
22 |
+
app = gr.Interface(predict,[gr.Video(label='Source image/video'),gr.Audio(type='filepath', label='Target Audio')], gr.Video(label="Out Video"))
|
23 |
+
app.launch()
|
|
|
24 |
|