Skip to content

Commit

Permalink
Minor precision fix on unproject
Browse files Browse the repository at this point in the history
  • Loading branch information
idilsulo committed Mar 6, 2023
1 parent d388881 commit 0187b24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch3d/renderer/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def unproject_points(self, xy_depth: torch.Tensor, **kwargs):
xy_depth = torch.cat((xy, depth), dim=2)
# unproject to the world coordinates
xyz_unproj_world = cameras.unproject_points(xy_depth, world_coordinates=True)
print(torch.allclose(xyz, xyz_unproj_world)) # True
print(torch.allclose(xyz, xyz_unproj_world, atol=1e-4)) # True
# unproject to the camera coordinates
xyz_unproj = cameras.unproject_points(xy_depth, world_coordinates=False)
print(torch.allclose(xyz_cam, xyz_unproj)) # True
Expand Down

0 comments on commit 0187b24

Please sign in to comment.