Spaces:
Sleeping
Sleeping
staswrs
commited on
Commit
·
016e264
1
Parent(s):
d23c9df
clean scene 2
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ import zipfile
|
|
21 |
import requests
|
22 |
import traceback
|
23 |
import trimesh
|
24 |
-
|
25 |
from inference_triposg import run_triposg
|
26 |
from triposg.pipelines.pipeline_triposg import TripoSGPipeline
|
27 |
from briarmbg import BriaRMBG
|
@@ -124,7 +124,12 @@ def generate(image_path, face_number=50000, guidance_scale=5.0, num_steps=25):
|
|
124 |
mesh.name = "geometry_0"
|
125 |
|
126 |
# Экспорт .glb вручную (иначе Trimesh добавляет сцену)
|
127 |
-
glb_data = mesh.export(file_type="glb")
|
|
|
|
|
|
|
|
|
|
|
128 |
with open(output_path, "wb") as f:
|
129 |
f.write(glb_data)
|
130 |
|
|
|
21 |
import requests
|
22 |
import traceback
|
23 |
import trimesh
|
24 |
+
from trimesh.exchange.gltf import export_glb
|
25 |
from inference_triposg import run_triposg
|
26 |
from triposg.pipelines.pipeline_triposg import TripoSGPipeline
|
27 |
from briarmbg import BriaRMBG
|
|
|
124 |
mesh.name = "geometry_0"
|
125 |
|
126 |
# Экспорт .glb вручную (иначе Trimesh добавляет сцену)
|
127 |
+
# glb_data = mesh.export(file_type="glb")
|
128 |
+
# with open(output_path, "wb") as f:
|
129 |
+
# f.write(glb_data)
|
130 |
+
|
131 |
+
|
132 |
+
glb_data = export_glb(mesh, include_scene=False)
|
133 |
with open(output_path, "wb") as f:
|
134 |
f.write(glb_data)
|
135 |
|