Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -347,14 +347,17 @@ def extract_glb(state: dict, mesh_simplify: float, texture_size: int) -> Tuple[s
|
|
347 |
# GLB ๋ณํ
|
348 |
with torch.inference_mode():
|
349 |
try:
|
350 |
-
#
|
351 |
-
for
|
352 |
-
if hasattr(
|
353 |
-
|
|
|
|
|
354 |
|
355 |
-
|
|
|
356 |
mesh.vertices.requires_grad_(False)
|
357 |
-
if hasattr(mesh, 'faces'):
|
358 |
mesh.faces.requires_grad_(False)
|
359 |
|
360 |
glb = postprocessing_utils.to_glb(
|
|
|
347 |
# GLB ๋ณํ
|
348 |
with torch.inference_mode():
|
349 |
try:
|
350 |
+
# Gaussian ๊ฐ์ฒด์ ํ
์๋ค์ ๋ํด requires_grad ์ค์
|
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 |
+
tensor.requires_grad_(False)
|
356 |
|
357 |
+
# Mesh ํ
์๋ค์ ๋ํด requires_grad ์ค์
|
358 |
+
if hasattr(mesh, 'vertices') and torch.is_tensor(mesh.vertices):
|
359 |
mesh.vertices.requires_grad_(False)
|
360 |
+
if hasattr(mesh, 'faces') and torch.is_tensor(mesh.faces):
|
361 |
mesh.faces.requires_grad_(False)
|
362 |
|
363 |
glb = postprocessing_utils.to_glb(
|