aiqtech commited on
Commit
304a9b5
Β·
verified Β·
1 Parent(s): 5ca7c6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
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() # facesλŠ” μ •μˆ˜ν˜•μœΌλ‘œ μœ μ§€
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 RuntimeError as e:
377
- print(f"GLB conversion failed with RuntimeError: {str(e)}")
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: