Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,23 @@
|
|
| 1 |
import subprocess
|
|
|
|
| 2 |
|
| 3 |
def setup_and_run():
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|