Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,31 +1,9 @@
|
|
| 1 |
-
import os
|
| 2 |
import subprocess
|
| 3 |
|
| 4 |
def setup_and_run():
|
| 5 |
-
# Print the current working directory
|
| 6 |
-
print("Current working directory:", os.getcwd())
|
| 7 |
-
|
| 8 |
-
# List the contents of the current directory
|
| 9 |
-
print("Contents of the current directory:", os.listdir('.'))
|
| 10 |
-
|
| 11 |
-
# Ensure 'V-Express' directory exists
|
| 12 |
-
if not os.path.exists('V-Express'):
|
| 13 |
-
return "Error: V-Express directory not found."
|
| 14 |
-
|
| 15 |
-
# List the contents of the 'V-Express' directory
|
| 16 |
-
print("Contents of V-Express directory:", os.listdir('V-Express'))
|
| 17 |
-
|
| 18 |
-
# Ensure 'inference.py' exists
|
| 19 |
-
if not os.path.exists('V-Express/inference.py'):
|
| 20 |
-
return "Error: inference.py file not found in V-Express directory."
|
| 21 |
-
|
| 22 |
# Run the setup script
|
| 23 |
subprocess.run(['bash', 'setup.sh'], check=True)
|
| 24 |
|
| 25 |
-
# Run the inference.py script directly if needed
|
| 26 |
-
inference_result = subprocess.run(['python', 'V-Express/inference.py'], capture_output=True, text=True)
|
| 27 |
-
print("Inference.py output:", inference_result.stdout + "\n" + inference_result.stderr)
|
| 28 |
-
|
| 29 |
# Run the gradio_inference.py script from the cloned repository
|
| 30 |
result = subprocess.run(['python', 'V-Express/extract_kps_sequence_and_audio.py'], capture_output=True, text=True)
|
| 31 |
return result.stdout + "\n" + result.stderr
|
|
|
|
|
|
|
| 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
|