Esempio n. 1
0
        def convert(og_mesh, voxel):
            transforms = tfs.Compose([mesh_conversion,
                                      tfs.MeshLaplacianSmoothing(smoothing_iterations)])

            new_mesh = transforms(voxel)
            new_mesh.vertices = pcfunc.realign(new_mesh.vertices, og_mesh.vertices)
            return {'vertices': new_mesh.vertices, 'faces': new_mesh.faces}
Esempio n. 2
0
def test_ModelNetPointCloud(device):
    transform = tfs.Compose([
        tfs.TriangleMeshToPointCloud(num_samples=32),
        tfs.NormalizePointCloud()
    ])
    models = kal.datasets.ModelNet(basedir=MODELNET_ROOT,
                                   categories=['bathtub'],
                                   split='test',
                                   transform=transform)

    assert len(models) == 50
    for obj, category in models:
        assert category.item() == 0
        assert isinstance(obj, torch.Tensor)
        assert obj.size(0) == 32