-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order of the points matters #6
Comments
Hi @xinshuoweng, thanks for trying this out! The order of the points shouldn't matter. Maybe the tensors aren't contiguous in memory. Try calling |
Hi @krrish94, thanks for your quick reply!! As you instructed, I tried contiguous() but it did not help. Here is how I re-order the points: where the 'choice' is just a list of indexes from 0 to the total number of points minus 1. When I use 'pts' (1 x 3 x M) and compare it with another GT point cloud (1 x 3 x N), the chamfer distance number is significantly different from feeding 'pts_return' and GT to the chamfer distance function. Any other thoughts regarding this would be greatly appreciated! |
Ah, I see your dimensions are |
Sorry that I should make this clear once. I did transpose it in my chamfer distance loss function, which is defined as follows:
It is just a simple wrapper of your function. I am used to the 3 x N format so that I add this wrapper function to your chamfer distance function. So I do not think the dimension is a problem. |
Thanks for the snippet; this looks weird indeed. I'm assuming you already tried If issues persist, I can try taking a look at this sometime tomorrow. |
Yes, I did add contiguous() for both point1 and point2 when calling the CDLOSS function. Also, your provided example is perfect and I can run it without any problem. I have been using your code (this chamfer distance function) for a year and see no problem until today with adding random re-ordering on the input point cloud. Thanks a lot!! I would appreciate it if you can take a look. To give your more context, I am using large-scale point clouds from the KITTI dataset, each point cloud has about 120,000 points. I will also in the meantime run more analysis. |
Hi @xinshuoweng, I tried a couple experiments on my end and in short, everything seems to be working okay. Here's a short snippet to help you reproduce results.
Both the Closing this, as it doesn't seem to be an issue with the package. Feel free to re-open if anything! |
Hi @krrish94 Sorry I was busy with other things recently and just came back to revisit this again. I finally found the bug. It is a mistake on my side. There is a transpose function I used right before calling the chamferDist function and the transposed point clouds which do not call the contiguous function cause this issue. Once I call contiguous() to the transposed point cloud, then everything works well. Thank you very much! Maybe one minor suggestion would be to add a call of contiguous inside chamferdist function so that if people forget to call it outside the chamferdist function, it is still safe. I appreciate your help throughout!! |
Hi, Thanks a lot for sharing your code here.
I have one question regarding the forward pass of the chamfer distance. In my experiments, I found that reordering the input point clouds will result in different chamfer distance results. Is it normal to happen? Is there some approximation happening in the code?
From what I understand in this paper: A Point Set Generation Network for 3D Object Reconstruction from a Single Image
The chamfer distance is defined agnostic to the ordering of the input points.
Would you mind clarifying this point?
Thanks!
The text was updated successfully, but these errors were encountered: