Don't apply near plane during eval (#716)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-10-06 12:22:27 -07:00
1 parent 9252a46273
commit eff62f7c6c
1 file changed
+4 -2
@@ -82,7 +82,8 @@ class AABBBoxCollider(SceneBoxCollider):
).values
# clamp to near plane
nears = torch.clamp(nears, min=self.near_plane)
near_plane = self.near_plane if self.training else 0
nears = torch.clamp(nears, min=near_plane)
return nears, fars
@@ -115,6 +116,7 @@ class NearFarCollider(SceneBoxCollider):
def forward(self, ray_bundle: RayBundle) -> RayBundle:
ones = torch.ones_like(ray_bundle.origins[..., 0:1])
ray_bundle.nears = ones * self.near_plane
near_plane = self.near_plane if self.training else 0
ray_bundle.nears = ones * near_plane
ray_bundle.fars = ones * self.far_plane
return ray_bundle