alexcanton commited on
Commit
2fb9769
1 Parent(s): f5108b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -6
app.py CHANGED
@@ -1,12 +1,23 @@
1
  import subprocess
 
2
 
3
  def setup_and_run():
4
- # Run the setup script
5
- subprocess.run(['bash', 'setup.sh'], check=True)
6
-
7
- # Run the gradio_inference.py script from the cloned repository
8
- result = subprocess.run(['python', 'V-Express/extract_kps_sequence_and_audio.py'], capture_output=True, text=True)
9
- return result.stdout + "\n" + result.stderr
 
 
 
 
 
 
 
 
 
 
10
 
11
  if __name__ == "__main__":
12
  output = setup_and_run()
 
1
  import subprocess
2
+ import os
3
 
4
  def setup_and_run():
5
+ try:
6
+ # Run the setup script
7
+ subprocess.run(['bash', 'setup.sh'], check=True)
8
+
9
+ # Change the working directory to V-Express
10
+ os.chdir('V-Express')
11
+
12
+ # Run the extract_kps_sequence_and_audio.py script from within the V-Express directory
13
+ result = subprocess.run(['python', 'extract_kps_sequence_and_audio.py'], capture_output=True, text=True)
14
+
15
+ # Change back to the original working directory
16
+ os.chdir('..')
17
+
18
+ return result.stdout + "\n" + result.stderr
19
+ except subprocess.CalledProcessError as e:
20
+ return f"An error occurred: {e}\n{e.output}"
21
 
22
  if __name__ == "__main__":
23
  output = setup_and_run()