goldpulpy commited on
Commit
0172d0a
1 Parent(s): 0b9c4df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -14
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
- print(f"Processing video {video} and audio {audio}")
12
- output_file = f"result/{random.randint(10,100000)}.mp4"
13
- command = ["python", "inference.py", "--face", video,
14
- "--audio", audio, "--outfile", output_file]
15
- subprocess.run(command, check=True)
16
- print(f"{output_file}")
17
- return output_file
18
-
19
-
20
- demo = gr.Interface(predict,[gr.Video(type="file",label='Source image/video'),gr.Audio(type='filepath', label='Target Audio')], gr.Video(label="Out"))
21
-
22
-
23
- if __name__ == "__main__":
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