mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 05:40:34 +08:00
MC rasterize supports heterogeneous bundle; refactoring of bundle-to-padded
Summary:
Rasterize MC was not adapted to heterogeneous bundles.
There are some caveats though:
1) on CO3D, we get up to 18 points per image, which is too few for a reasonable visualisation (see below);
2) rasterising for a batch of 100 is slow.
I also moved the unpacking code close to the bundle to be able to reuse it.
{F789678778}
Reviewed By: bottler, davnov134
Differential Revision: D41008600
fbshipit-source-id: 9f10f1f9f9a174cf8c534b9b9859587d69832b71
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7be49bf46f
commit
f3c1e0837c
@@ -188,6 +188,16 @@ class TestPackedToPadded(TestCaseMixin, unittest.TestCase):
|
||||
# check forward
|
||||
self.assertClose(values_packed, values_packed_torch)
|
||||
|
||||
if len(dims) > 0:
|
||||
values_packed_dim2 = padded_to_packed(
|
||||
values.transpose(1, 2),
|
||||
mesh_to_faces_packed_first_idx,
|
||||
num_faces_per_mesh.sum().item(),
|
||||
max_size_dim=2,
|
||||
)
|
||||
# check forward
|
||||
self.assertClose(values_packed_dim2, values_packed_torch)
|
||||
|
||||
# check backward
|
||||
if len(dims) == 0:
|
||||
grad_inputs = torch.rand((num_faces_per_mesh.sum().item()), device=device)
|
||||
|
||||
Reference in New Issue
Block a user