ranahanocka / point2mesh

Reconstruct Watertight Meshes from Point Clouds [SIGGRAPH 2020]
MIT License
1.09k stars 122 forks source link

Issues with custom data #35

Open felipesce opened 2 years ago

felipesce commented 2 years ago

Hello.

I'm having issues building a convex hull and then adapting the scripts to my own point clouds. I seem to have been able to build the hull.obj file, but I'm not sure if it has problems.

When running the script, there's an error in models/losses.py: this line

cham_norm_x = F.cosine_similarity(x_normals, x_normals_near, dim=2, eps=1e-6)

The error is:

RuntimeError: The size of tensor a (3) must match the size of tensor b (0) at non-singleton dimension 2

x_normals.shape = torch.Size([1, 15000, 3]) x_normals_near.shape = torch.Size([1, 15000, 0])

I have no idea where I went wrong, any help would be deeply appreciated.

Thanks!

jiayaozi commented 1 year ago

hello , i have the same error. Have you solved that?

gavinleong commented 1 year ago

Hi, had the same problem. I solved it by noticing that the giraffe.ply point cloud file in the examples folder has normals listed next to the vertex, so I put my custom point cloud file onto CloudCompare, calculated the normals, exported the point cloud as an ascii .ply file and tried again, and it seems to not produce the error.

Also notice the error in the losses.py script features mostly "normals" related variables, so that would be the hint at the problem.