chamferdist icon indicating copy to clipboard operation
chamferdist copied to clipboard

Distance Not Normalized

Open guohaoxiang opened this issue 3 years ago • 4 comments

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?

guohaoxiang avatar Aug 18 '21 08:08 guohaoxiang

Same issue here

XueHu1995 avatar Sep 23 '21 08:09 XueHu1995

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

Yihanhu avatar Oct 05 '21 00:10 Yihanhu

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

pansanity666 avatar Apr 11 '22 13:04 pansanity666

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

ghost avatar Jul 23 '22 15:07 ghost