Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,22 @@
|
|
1 |
import random
|
2 |
import subprocess
|
3 |
-
import os
|
4 |
import gradio as gr
|
5 |
-
import requests
|
6 |
|
7 |
|
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 |
-
|
|
|
|
|
|
|
|
|
24 |
|
|
|
1 |
import random
|
2 |
import subprocess
|
|
|
3 |
import gradio as gr
|
|
|
4 |
|
5 |
|
|
|
|
|
6 |
def predict(video, audio):
|
7 |
try:
|
|
|
8 |
output_file = f"result/{random.randint(10,100000)}.mp4"
|
9 |
command = ["python", "inference.py", "--face", video,
|
10 |
"--audio", audio, "--outfile", output_file]
|
11 |
subprocess.run(command, check=True)
|
|
|
12 |
return output_file
|
13 |
except: pass
|
14 |
|
15 |
|
16 |
app = gr.Interface(predict,[gr.Video(label='Source image/video'),gr.Audio(type='filepath', label='Target Audio')], gr.Video(label="Out Video"))
|
17 |
+
|
18 |
+
|
19 |
+
if __name__ == "__main__":
|
20 |
+
app.launch()
|
21 |
+
|
22 |
|