DeyvidKochanov-TomTom / kprnet

MIT License
65 stars 12 forks source link

Why use px-py before np.floor as the position of grid_sample? #14

Closed huixiancheng closed 3 years ago

huixiancheng commented 3 years ago

https://github.com/DeyvidKochanov-TomTom/kprnet/blob/587a616b955b6be55b223e031e9ed39a8588d149/datasets/semantic_kitti.py#L176-L180. why use float not int? Not very clear about the work way of F.grid_sample.

DeyvidKochanov-TomTom commented 3 years ago

Hi, grid_sample expects values between -1 and 1, and then interpolates the feature at the given coordinates. Its just a way to get back the features for the 3D points from cnn in a way that allows you to backpropagate. But indeed maybe it would be more correct to use the floor()-ed values

huixiancheng commented 3 years ago

Oh! Sorry, I missed it. Forget that we have normalization it between [-1,1] in dataset transorm. Thank you for the quick answer