dkatz2391 commited on
Commit
45d8d33
·
verified ·
1 Parent(s): bd7d765

logging for textrure fail

Browse files
Files changed (1) hide show
  1. app.py +20 -6
app.py CHANGED
@@ -151,12 +151,26 @@ def extract_glb(
151
  """
152
  user_dir = os.path.join(TMP_DIR, str(req.session_hash))
153
  os.makedirs(user_dir, exist_ok=True)
154
- gs, mesh = unpack_state(state)
155
- glb = postprocessing_utils.to_glb(gs, mesh, simplify=mesh_simplify, texture_size=texture_size, verbose=False)
156
- glb_path = os.path.join(user_dir, 'sample.glb')
157
- glb.export(glb_path)
158
- torch.cuda.empty_cache()
159
- return glb_path, glb_path
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
 
162
  @spaces.GPU
 
151
  """
152
  user_dir = os.path.join(TMP_DIR, str(req.session_hash))
153
  os.makedirs(user_dir, exist_ok=True)
154
+ logging.info(f"[{str(req.session_hash)[:8]}] ENTER extract_glb - Simplify: {mesh_simplify}, Texture Size: {texture_size}")
155
+ try:
156
+ gs, mesh = unpack_state(state)
157
+ logging.info(f"[{str(req.session_hash)[:8]}] State unpacked successfully.")
158
+
159
+ # Call to_glb with verbose=True
160
+ logging.info(f"[{str(req.session_hash)[:8]}] Calling postprocessing_utils.to_glb with verbose=True...")
161
+ glb = postprocessing_utils.to_glb(gs, mesh, simplify=mesh_simplify, texture_size=texture_size, verbose=True)
162
+ logging.info(f"[{str(req.session_hash)[:8]}] postprocessing_utils.to_glb completed.")
163
+
164
+ glb_path = os.path.join(user_dir, 'sample.glb')
165
+ glb.export(glb_path)
166
+ logging.info(f"[{str(req.session_hash)[:8]}] GLB exported to {glb_path}")
167
+ torch.cuda.empty_cache()
168
+ logging.info(f"[{str(req.session_hash)[:8]}] EXIT extract_glb - Success")
169
+ return glb_path, glb_path
170
+ except Exception as e:
171
+ logging.error(f"[{str(req.session_hash)[:8]}] ERROR in extract_glb: {e}", exc_info=True)
172
+ torch.cuda.empty_cache()
173
+ raise gr.Error(f"GLB Extraction failed: {e}")
174
 
175
 
176
  @spaces.GPU