Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -352,7 +352,6 @@ def extract_glb(state: dict, mesh_simplify: float, texture_size: int) -> Tuple[s
|
|
352 |
if hasattr(gs, attr_name):
|
353 |
tensor = getattr(gs, attr_name)
|
354 |
if torch.is_tensor(tensor):
|
355 |
-
# ν
μλ₯Ό float32λ‘ λ³ν
|
356 |
new_tensor = tensor.clone().detach().float()
|
357 |
setattr(gs, attr_name, new_tensor)
|
358 |
|
@@ -360,29 +359,26 @@ def extract_glb(state: dict, mesh_simplify: float, texture_size: int) -> Tuple[s
|
|
360 |
if hasattr(mesh, 'vertices') and torch.is_tensor(mesh.vertices):
|
361 |
mesh.vertices = mesh.vertices.clone().detach().float()
|
362 |
if hasattr(mesh, 'faces') and torch.is_tensor(mesh.faces):
|
363 |
-
mesh.faces = mesh.faces.clone().detach().long()
|
364 |
|
365 |
# GLB λ³ν μλ
|
366 |
try:
|
|
|
367 |
glb = postprocessing_utils.to_glb(
|
368 |
gs,
|
369 |
mesh,
|
370 |
simplify=mesh_simplify,
|
371 |
texture_size=texture_size,
|
372 |
-
verbose=True
|
373 |
-
optimize_uv=True,
|
374 |
-
optimize_steps=2500
|
375 |
)
|
376 |
-
except
|
377 |
-
print(f"GLB conversion failed
|
378 |
-
#
|
379 |
glb = postprocessing_utils.to_glb(
|
380 |
gs,
|
381 |
mesh,
|
382 |
simplify=mesh_simplify,
|
383 |
-
texture_size=texture_size
|
384 |
-
verbose=True,
|
385 |
-
optimize_uv=False
|
386 |
)
|
387 |
|
388 |
except Exception as e:
|
|
|
352 |
if hasattr(gs, attr_name):
|
353 |
tensor = getattr(gs, attr_name)
|
354 |
if torch.is_tensor(tensor):
|
|
|
355 |
new_tensor = tensor.clone().detach().float()
|
356 |
setattr(gs, attr_name, new_tensor)
|
357 |
|
|
|
359 |
if hasattr(mesh, 'vertices') and torch.is_tensor(mesh.vertices):
|
360 |
mesh.vertices = mesh.vertices.clone().detach().float()
|
361 |
if hasattr(mesh, 'faces') and torch.is_tensor(mesh.faces):
|
362 |
+
mesh.faces = mesh.faces.clone().detach().long()
|
363 |
|
364 |
# GLB λ³ν μλ
|
365 |
try:
|
366 |
+
# optimize_uv 맀κ°λ³μ μ κ±°
|
367 |
glb = postprocessing_utils.to_glb(
|
368 |
gs,
|
369 |
mesh,
|
370 |
simplify=mesh_simplify,
|
371 |
texture_size=texture_size,
|
372 |
+
verbose=True
|
|
|
|
|
373 |
)
|
374 |
+
except Exception as e:
|
375 |
+
print(f"First GLB conversion attempt failed: {str(e)}")
|
376 |
+
# κ°λ¨ν μ€μ μΌλ‘ λ€μ μλ
|
377 |
glb = postprocessing_utils.to_glb(
|
378 |
gs,
|
379 |
mesh,
|
380 |
simplify=mesh_simplify,
|
381 |
+
texture_size=texture_size
|
|
|
|
|
382 |
)
|
383 |
|
384 |
except Exception as e:
|