mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-21 06:40:35 +08:00
coarse rasterization bug fix
Summary: Fix a bug which resulted in a rendering artifacts if the image size was not a multiple of 16. Fix: Revert coarse rasterization to original implementation and only update fine rasterization to reverse the ordering of Y and X axis. This is much simpler than the previous approach! Additional changes: - updated mesh rendering end-end tests to check outputs from both naive and coarse to fine rasterization. - added pointcloud rendering end-end tests Reviewed By: gkioxari Differential Revision: D21102725 fbshipit-source-id: 2e7e1b013dd6dd12b3a00b79eb8167deddb2e89a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1e4749602d
commit
9ef1ee8455
@@ -896,10 +896,10 @@ class TestRasterizeMeshes(TestCaseMixin, unittest.TestCase):
|
||||
torch.ones((1, 2, 2, max_faces_per_bin), dtype=torch.int32, device=device)
|
||||
* -1
|
||||
)
|
||||
bin_faces_expected[0, 0, 0, 0] = torch.tensor([1])
|
||||
bin_faces_expected[0, 1, 0, 0:2] = torch.tensor([1, 2])
|
||||
bin_faces_expected[0, 0, 1, 0:2] = torch.tensor([0, 1])
|
||||
bin_faces_expected[0, 1, 1, 0] = torch.tensor([1])
|
||||
bin_faces_expected[0, 0, 1, 0:2] = torch.tensor([1, 2])
|
||||
bin_faces_expected[0, 1, 0, 0:2] = torch.tensor([0, 1])
|
||||
bin_faces_expected[0, 0, 0, 0] = torch.tensor([1])
|
||||
|
||||
# +Y up, +X left, +Z in
|
||||
bin_faces = _C._rasterize_meshes_coarse(
|
||||
@@ -911,7 +911,7 @@ class TestRasterizeMeshes(TestCaseMixin, unittest.TestCase):
|
||||
bin_size,
|
||||
max_faces_per_bin,
|
||||
)
|
||||
# Flip x and y axis of output before comparing to expected
|
||||
|
||||
bin_faces_same = (bin_faces.squeeze() == bin_faces_expected).all()
|
||||
self.assertTrue(bin_faces_same.item() == 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user