Spaces:
Running
Running
Restore app.py from Make-It-Animatable
Browse files
app.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Gradio ZeroGPU entry point for the existing Make-It-Animatable workflow."""
|
| 2 |
+
import os
|
| 3 |
+
import subprocess
|
| 4 |
+
import sys
|
| 5 |
+
|
| 6 |
+
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
| 7 |
+
subprocess.run(["bash", "install.sh"], check=True)
|
| 8 |
+
|
| 9 |
+
import spaces
|
| 10 |
+
import torch
|
| 11 |
+
import torchvision
|
| 12 |
+
import torch_cluster
|
| 13 |
+
import pytorch3d
|
| 14 |
+
import bpy
|
| 15 |
+
import gradio
|
| 16 |
+
|
| 17 |
+
print(
|
| 18 |
+
"STARTUP_VERSIONS "
|
| 19 |
+
f"python={sys.version.split()[0]} torch={torch.__version__} "
|
| 20 |
+
f"torchvision={torchvision.__version__} cuda_wheel={torch.version.cuda} "
|
| 21 |
+
f"torch_cluster={getattr(torch_cluster, '__version__', 'unknown')} "
|
| 22 |
+
f"pytorch3d={pytorch3d.__version__} bpy={bpy.app.version_string} "
|
| 23 |
+
f"gradio={gradio.__version__}", flush=True)
|
| 24 |
+
assert torch.__version__.startswith("2.8.0"), "ZeroGPU build did not install Torch 2.8.0"
|
| 25 |
+
|
| 26 |
+
from app.app import *
|
| 27 |
+
|
| 28 |
+
init_models()
|
| 29 |
+
demo = init_blocks()
|
| 30 |
+
demo.launch(server_name="0.0.0.0", server_port=7860,
|
| 31 |
+
allowed_paths=[".", "/data/app/data/Standard Run.fbx", "/data/app/output"],
|
| 32 |
+
show_error=True, ssr_mode=False)
|