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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -7
app.py CHANGED
@@ -346,13 +346,28 @@ def extract_glb(state: dict, mesh_simplify: float, texture_size: int) -> Tuple[s
346
 
347
  # GLB ๋ณ€ํ™˜
348
  with torch.inference_mode():
349
- glb = postprocessing_utils.to_glb(
350
- gs,
351
- mesh,
352
- simplify=mesh_simplify,
353
- texture_size=texture_size,
354
- verbose=True # ๋””๋ฒ„๊น…์„ ์œ„ํ•ด verbose ๋ชจ๋“œ ํ™œ์„ฑํ™”
355
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
 
357
  if glb is None:
358
  print("Error: GLB conversion failed")
 
346
 
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(
361
+ gs,
362
+ mesh,
363
+ simplify=mesh_simplify,
364
+ texture_size=texture_size,
365
+ verbose=True
366
+ )
367
+
368
+ except RuntimeError as e:
369
+ print(f"Runtime error during GLB conversion: {str(e)}")
370
+ return None, None
371
 
372
  if glb is None:
373
  print("Error: GLB conversion failed")