aiqtech commited on
Commit
9db503b
ยท
verified ยท
1 Parent(s): a98ee90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
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
- # ํ…์„œ๋“ค์˜ requires_grad๋ฅผ False๋กœ ์„ค์ •
351
- for param in gs.parameters():
352
- if hasattr(param, 'requires_grad'):
353
- param.requires_grad_(False)
 
 
354
 
355
- if hasattr(mesh, 'vertices'):
 
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(