mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-20 22:30:35 +08:00
Non square image rasterization for meshes
Summary: There are a couple of options for supporting non square images: 1) NDC stays at [-1, 1] in both directions with the distance calculations all modified by (W/H). There are a lot of distance based calculations (e.g. triangle areas for barycentric coordinates etc) so this requires changes in many places. 2) NDC is scaled by (W/H) so the smallest side has [-1, 1]. In this case none of the distance calculations need to be updated and only the pixel to NDC calculation needs to be modified. I decided to go with option 2 after trying option 1! API Changes: - Image size can now be specified optionally as a tuple TODO: - add a benchmark test for the non square case. Reviewed By: jcjohnson Differential Revision: D24404975 fbshipit-source-id: 545efb67c822d748ec35999b35762bce58db2cf4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0216e4689a
commit
d07307a451
@@ -304,7 +304,7 @@ class TestRasterizeMeshes(TestCaseMixin, unittest.TestCase):
|
||||
def test_compare_coarse_cpu_vs_cuda(self):
|
||||
torch.manual_seed(231)
|
||||
N = 1
|
||||
image_size = 512
|
||||
image_size = (512, 512)
|
||||
blur_radius = 0.0
|
||||
bin_size = 32
|
||||
max_faces_per_bin = 20
|
||||
@@ -1077,7 +1077,7 @@ class TestRasterizeMeshes(TestCaseMixin, unittest.TestCase):
|
||||
self.assertClose(dists, expected_dists)
|
||||
|
||||
def _test_coarse_rasterize(self, device):
|
||||
image_size = 16
|
||||
image_size = (16, 16)
|
||||
# No blurring. This test checks that the XY directions are
|
||||
# correctly oriented.
|
||||
blur_radius = 0.0
|
||||
|
||||
Reference in New Issue
Block a user