PyTorch3D - Avoid flip in TexturesAtlas

Summary: Performance improvement: Use torch.lerp to map uv coordinates to the range needed for grid_sample (i.e. map [0, 1] to [-1, 1] and invert the y-axis)

Reviewed By: bottler

Differential Revision: D51961728

fbshipit-source-id: db19a5e3f482e9af7b96b20f88a1e5d0076dac43
This commit is contained in:
Eric Young
2023-12-11 12:49:17 -08:00
committed by Facebook GitHub Bot
parent 94da8841af
commit 06cdc313a7
2 changed files with 13 additions and 5 deletions

View File

@@ -932,7 +932,7 @@ class TestRenderMeshes(TestCaseMixin, unittest.TestCase):
)
).save(DATA_DIR / f"DEBUG_test_joinuvs{i}_map3.png")
self.assertClose(output, merged)
self.assertClose(output, merged, atol=0.005)
self.assertClose(output, image_ref, atol=0.005)
self.assertClose(mesh.textures.maps_padded()[0].cpu(), map_ref, atol=0.05)