mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-20 22:30:35 +08:00
Test gltf texture without renderer.
Summary: Change the cow gltf loading test to validate the texture values and not to validate the renderer output because it has an unstable pixel. Also a couple of lints. Reviewed By: patricklabatut Differential Revision: D29131260 fbshipit-source-id: 5e11f066a2a638588aacb09776cc842173ef669f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9c09c0d316
commit
31c448a95d
@@ -143,14 +143,26 @@ class TestMeshGltfIO(TestCaseMixin, unittest.TestCase):
|
||||
mesh_obj.get_bounding_boxes().cpu(), mesh_obj.get_bounding_boxes()
|
||||
)
|
||||
|
||||
self.assertClose(
|
||||
mesh.textures.verts_uvs_padded().cpu(), mesh_obj.textures.verts_uvs_padded()
|
||||
)
|
||||
|
||||
self.assertClose(
|
||||
mesh.textures.faces_uvs_padded().cpu(), mesh_obj.textures.faces_uvs_padded()
|
||||
)
|
||||
|
||||
self.assertClose(
|
||||
mesh.textures.maps_padded().cpu(), mesh_obj.textures.maps_padded()
|
||||
)
|
||||
|
||||
if DEBUG:
|
||||
texturesuv_image_PIL(mesh.textures).save(DATA_DIR / "out_cow.png")
|
||||
image = _render(mesh, "cow", azim=4)
|
||||
|
||||
with Image.open(DATA_DIR / "glb_cow.png") as f:
|
||||
expected = np.array(f)
|
||||
image = _render(mesh, "cow", azim=4)
|
||||
with Image.open(DATA_DIR / "glb_cow.png") as f:
|
||||
expected = np.array(f)
|
||||
|
||||
self.assertClose(image, expected)
|
||||
self.assertClose(image, expected)
|
||||
|
||||
def test_load_cow_no_texture(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user