Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -347,20 +347,20 @@ def extract_glb(state: dict, mesh_simplify: float, texture_size: int) -> Tuple[s
|
|
347 |
# GLB λ³ν
|
348 |
with torch.inference_mode():
|
349 |
try:
|
350 |
-
# Gaussian ν
μλ€μ
|
351 |
for attr_name in ['_xyz', '_features_dc', '_scaling', '_rotation', '_opacity']:
|
352 |
if hasattr(gs, attr_name):
|
353 |
tensor = getattr(gs, attr_name)
|
354 |
if torch.is_tensor(tensor):
|
355 |
-
# ν
μλ₯Ό
|
356 |
-
new_tensor = tensor.clone().detach().
|
357 |
setattr(gs, attr_name, new_tensor)
|
358 |
|
359 |
-
# Mesh ν
μλ€μ
|
360 |
if hasattr(mesh, 'vertices') and torch.is_tensor(mesh.vertices):
|
361 |
-
mesh.vertices = mesh.vertices.clone().detach().
|
362 |
if hasattr(mesh, 'faces') and torch.is_tensor(mesh.faces):
|
363 |
-
mesh.faces = mesh.faces.clone().detach().
|
364 |
|
365 |
# GLB λ³ν μλ
|
366 |
try:
|
@@ -370,8 +370,8 @@ def extract_glb(state: dict, mesh_simplify: float, texture_size: int) -> Tuple[s
|
|
370 |
simplify=mesh_simplify,
|
371 |
texture_size=texture_size,
|
372 |
verbose=True,
|
373 |
-
optimize_uv=True,
|
374 |
-
optimize_steps=2500
|
375 |
)
|
376 |
except RuntimeError as e:
|
377 |
print(f"GLB conversion failed with RuntimeError: {str(e)}")
|
@@ -382,7 +382,7 @@ def extract_glb(state: dict, mesh_simplify: float, texture_size: int) -> Tuple[s
|
|
382 |
simplify=mesh_simplify,
|
383 |
texture_size=texture_size,
|
384 |
verbose=True,
|
385 |
-
optimize_uv=False
|
386 |
)
|
387 |
|
388 |
except Exception as e:
|
|
|
347 |
# GLB λ³ν
|
348 |
with torch.inference_mode():
|
349 |
try:
|
350 |
+
# Gaussian ν
μλ€μ float32λ‘ λ³ν
|
351 |
for attr_name in ['_xyz', '_features_dc', '_scaling', '_rotation', '_opacity']:
|
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 |
|
359 |
+
# Mesh ν
μλ€μ float32λ‘ λ³ν
|
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() # facesλ μ μνμΌλ‘ μ μ§
|
364 |
|
365 |
# GLB λ³ν μλ
|
366 |
try:
|
|
|
370 |
simplify=mesh_simplify,
|
371 |
texture_size=texture_size,
|
372 |
verbose=True,
|
373 |
+
optimize_uv=True,
|
374 |
+
optimize_steps=2500
|
375 |
)
|
376 |
except RuntimeError as e:
|
377 |
print(f"GLB conversion failed with RuntimeError: {str(e)}")
|
|
|
382 |
simplify=mesh_simplify,
|
383 |
texture_size=texture_size,
|
384 |
verbose=True,
|
385 |
+
optimize_uv=False
|
386 |
)
|
387 |
|
388 |
except Exception as e:
|