Wuvin commited on
Commit
b73f7a7
1 Parent(s): b869920
Files changed (1) hide show
  1. scripts/project_mesh.py +3 -1
scripts/project_mesh.py CHANGED
@@ -95,9 +95,11 @@ class Pix2FacesRenderer:
95
  pix_to_face = rast_out[..., -1].to(torch.int32) - 1
96
  return pix_to_face
97
 
98
- pix2faces_renderer = Pix2FacesRenderer()
99
 
100
  def get_visible_faces(meshes: Meshes, cameras: CamerasBase, resolution=1024):
 
 
101
  # pix_to_face = render_pix2faces_py3d(meshes, cameras, H=resolution, W=resolution)['pix_to_face']
102
  pix_to_face = pix2faces_renderer.render_pix2faces_nvdiff(meshes, cameras, H=resolution, W=resolution)
103
 
 
95
  pix_to_face = rast_out[..., -1].to(torch.int32) - 1
96
  return pix_to_face
97
 
98
+ pix2faces_renderer = None
99
 
100
  def get_visible_faces(meshes: Meshes, cameras: CamerasBase, resolution=1024):
101
+ if pix2faces_renderer is None:
102
+ pix2faces_renderer = Pix2FacesRenderer()
103
  # pix_to_face = render_pix2faces_py3d(meshes, cameras, H=resolution, W=resolution)['pix_to_face']
104
  pix_to_face = pix2faces_renderer.render_pix2faces_nvdiff(meshes, cameras, H=resolution, W=resolution)
105