krrish94 / chamferdist

Pytorch package to compute Chamfer distance between point sets (pointclouds).
Other
308 stars 50 forks source link

Distance Not Normalized #14

Open guohaoxiang opened 3 years ago

guohaoxiang commented 3 years ago

a = torch.zeros(21).view(1,-1,3) b = a + 1 dist = chamferDist(a, b)

The expected distance between a and b should be sqrt(3), however, chamferDist(a,b) returns 21. Is it because the distance not divided by the number of points?

XueHu1995 commented 3 years ago

Same issue here

Yihanhu commented 3 years ago

https://github.com/krrish94/chamferdist/blob/master/chamferdist/chamfer.py#L102 There is a bug here.

pansanity666 commented 2 years ago

The chamfer distance defined here is not normalized and is squared. I think it depends on which kind of formulation you used.

ghost commented 2 years ago

For this issue, if each data(target and source) have 100 points, should we divide the result obtained by executing this code by 100?