facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.7k stars 1.3k forks source link

Computing chamfer loss with mahalanobis distance #1685

Closed HarshitGupta29 closed 10 months ago

HarshitGupta29 commented 10 months ago

Discussed in https://github.com/facebookresearch/pytorch3d/discussions/1684

Originally posted by **HarshitGupta29** November 9, 2023 Hi, I have a gaussian point cloud and a point cloud. I want to compute chamfer loss between them, but using normal chamfer loss is not accurate. I want to replace euclidean distance with mahalanobis distance. Both point clouds are pretty large so I am hesistant to write my own function. I can find whitening matrices for gaussian point cloud and then multiply it with the difference ||W(x-p)||. Any tricks I could use to compute this ? Any ideas or help is appreciated!
bottler commented 10 months ago

There are no particular tricks. Is the problem that transforming the input and using our function runs out of memory? Could you use an inplace operation to transform it?

HarshitGupta29 commented 10 months ago

I implemented it and the code is available here: https://github.com/HarshitGupta29/3D-Chamfer-Loss-with-Mahalanobis-Distance