Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,16 +14,27 @@ from PIL import Image
|
|
| 14 |
from trellis.pipelines import TrellisImageTo3DPipeline
|
| 15 |
from trellis.representations import Gaussian, MeshExtractResult
|
| 16 |
from trellis.utils import render_utils, postprocessing_utils
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
MAX_SEED = np.iinfo(np.int32).max
|
| 20 |
TMP_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tmp')
|
| 21 |
os.makedirs(TMP_DIR, exist_ok=True)
|
| 22 |
|
|
|
|
|
|
|
| 23 |
|
| 24 |
def start_session(req: gr.Request):
|
| 25 |
user_dir = os.path.join(TMP_DIR, str(req.session_hash))
|
| 26 |
os.makedirs(user_dir, exist_ok=True)
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
def end_session(req: gr.Request):
|
|
|
|
| 14 |
from trellis.pipelines import TrellisImageTo3DPipeline
|
| 15 |
from trellis.representations import Gaussian, MeshExtractResult
|
| 16 |
from trellis.utils import render_utils, postprocessing_utils
|
| 17 |
+
import gradio as gr
|
| 18 |
+
from gradio_client import Client, handle_file
|
| 19 |
+
from gradio_client.exceptions import AppError
|
| 20 |
+
from gradio_litmodel3d import LitModel3D
|
| 21 |
+
|
| 22 |
+
import tempfile
|
| 23 |
+
import trimesh
|
| 24 |
+
import time
|
| 25 |
|
| 26 |
|
| 27 |
MAX_SEED = np.iinfo(np.int32).max
|
| 28 |
TMP_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tmp')
|
| 29 |
os.makedirs(TMP_DIR, exist_ok=True)
|
| 30 |
|
| 31 |
+
RIGNET_SPACE = "ckc99u/spaceB" # Your RigNet space
|
| 32 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 33 |
|
| 34 |
def start_session(req: gr.Request):
|
| 35 |
user_dir = os.path.join(TMP_DIR, str(req.session_hash))
|
| 36 |
os.makedirs(user_dir, exist_ok=True)
|
| 37 |
+
os.makedirs(user_dir, exist_ok=True)
|
| 38 |
|
| 39 |
|
| 40 |
def end_session(req: gr.Request):
|