Spaces:
mashroo
/
Runtime error

YoussefAnso commited on
Commit
841251d
·
1 Parent(s): 57a43ce

Update mesh export in inference.py to use .glb suffix for temporary files and return the correct path without appending .obj. This improves file handling consistency.

Browse files
Files changed (1) hide show
  1. inference.py +2 -2
inference.py CHANGED
@@ -73,7 +73,7 @@ def generate3d(model, rgb, ccm, device):
73
 
74
  start_time = time.time()
75
  with torch.no_grad():
76
- mesh_path_glb = tempfile.NamedTemporaryFile(suffix=f"", delete=False).name
77
  model.export_mesh(data_config, mesh_path_glb, tri_fea_2 = triplane_feature2)
78
 
79
  # glctx = dr.RasterizeGLContext()#dr.RasterizeCudaContext()
@@ -96,4 +96,4 @@ def generate3d(model, rgb, ccm, device):
96
  end_time = time.time()
97
  elapsed_time = end_time - start_time
98
  print(f"uv takes {elapsed_time}s")
99
- return mesh_path_glb+".obj"
 
73
 
74
  start_time = time.time()
75
  with torch.no_grad():
76
+ mesh_path_glb = tempfile.NamedTemporaryFile(suffix=f".glb", delete=False).name
77
  model.export_mesh(data_config, mesh_path_glb, tri_fea_2 = triplane_feature2)
78
 
79
  # glctx = dr.RasterizeGLContext()#dr.RasterizeCudaContext()
 
96
  end_time = time.time()
97
  elapsed_time = end_time - start_time
98
  print(f"uv takes {elapsed_time}s")
99
+ return mesh_path_glb