mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 22:00:35 +08:00
Joining mismatched texture maps on CUDA #175
Summary: Use nn.functional.interpolate instead of a TorchVision transform to resize texture maps to a common value. This works on all devices. This fixes issue #175. Also fix the condition so it only happens when needed. Reviewed By: nikhilaravi Differential Revision: D21324510 fbshipit-source-id: c50eb06514984995bd81f2c44079be6e0b4098e4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e64e0d17ef
commit
0c595dcf5b
@@ -607,6 +607,12 @@ class TestMeshObjIO(TestCaseMixin, unittest.TestCase):
|
||||
check_triple(mesh, mesh3)
|
||||
self.assertTupleEqual(mesh.textures.maps_padded().shape, (1, 1024, 1024, 3))
|
||||
|
||||
# Try mismatched texture map sizes, which needs a call to interpolate()
|
||||
mesh2048 = mesh.clone()
|
||||
maps = mesh.textures.maps_padded()
|
||||
mesh2048.textures._maps_padded = torch.cat([maps, maps], dim=1)
|
||||
join_meshes_as_batch([mesh.to("cuda:0"), mesh2048.to("cuda:0")])
|
||||
|
||||
mesh_notex = load_objs_as_meshes([obj_filename], load_textures=False)
|
||||
mesh3_notex = load_objs_as_meshes(
|
||||
[obj_filename, obj_filename, obj_filename], load_textures=False
|
||||
|
||||
Reference in New Issue
Block a user