Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import sys
|
|
| 5 |
import tempfile
|
| 6 |
import shutil
|
| 7 |
import subprocess
|
|
|
|
| 8 |
|
| 9 |
# --- Configuration ---
|
| 10 |
# Path to the cloned UniRig repository directory within the Space
|
|
@@ -29,6 +30,7 @@ if DEVICE.type == 'cuda':
|
|
| 29 |
else:
|
| 30 |
print("Warning: CUDA not available or not detected by PyTorch. UniRig performance will be severely impacted.")
|
| 31 |
|
|
|
|
| 32 |
def run_unirig_command(command_args, step_name):
|
| 33 |
"""Helper function to run UniRig commands using subprocess."""
|
| 34 |
python_exe = sys.executable # Use the current python interpreter
|
|
@@ -66,6 +68,7 @@ def run_unirig_command(command_args, step_name):
|
|
| 66 |
|
| 67 |
|
| 68 |
# --- Core Rigging Function ---
|
|
|
|
| 69 |
def rig_glb_mesh_multistep(input_glb_file_obj):
|
| 70 |
"""
|
| 71 |
Takes an input GLB file object, rigs it using the new UniRig multi-step process,
|
|
|
|
| 5 |
import tempfile
|
| 6 |
import shutil
|
| 7 |
import subprocess
|
| 8 |
+
import spaces
|
| 9 |
|
| 10 |
# --- Configuration ---
|
| 11 |
# Path to the cloned UniRig repository directory within the Space
|
|
|
|
| 30 |
else:
|
| 31 |
print("Warning: CUDA not available or not detected by PyTorch. UniRig performance will be severely impacted.")
|
| 32 |
|
| 33 |
+
@spaces.GPU
|
| 34 |
def run_unirig_command(command_args, step_name):
|
| 35 |
"""Helper function to run UniRig commands using subprocess."""
|
| 36 |
python_exe = sys.executable # Use the current python interpreter
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
# --- Core Rigging Function ---
|
| 71 |
+
@spaces.GPU
|
| 72 |
def rig_glb_mesh_multistep(input_glb_file_obj):
|
| 73 |
"""
|
| 74 |
Takes an input GLB file object, rigs it using the new UniRig multi-step process,
|