autonomousvision / convolutional_occupancy_networks

[ECCV'20] Convolutional Occupancy Networks
https://pengsongyou.github.io/conv_onet
MIT License
830 stars 113 forks source link

sample_grid_feature in LocalDecoder #35

Closed qiminchen closed 2 years ago

qiminchen commented 3 years ago

Hi, I'm wondering what does these two lines do? so the input points to the decoder has a shape of B x num_points x 3 and line 60 changes it to B x num_points x 1 x 1 x 3? Also why do you need to normalize it from [0, 1] to [-1, 1] for the grip sampling? Thanks

https://github.com/autonomousvision/convolutional_occupancy_networks/blob/f44d413f8d455657a44c24d06163934c69141a09/src/conv_onet/models/decoder.py#L60-L61

liopeer commented 4 months ago

@qiminchen could you explain this to me? I am also struggling to understand the tensor shape of the methods in the decoder.

qiminchen commented 4 months ago

@liopeer the input c is of size (B, C, H_in, W_in, D_in) and the query points vgrid should be of size (B, num_points, 1, 1, 3), so theF.grid_sample(c, vgrid) in line 63 will output the values of all the query points with size (B, num_points, 1, 1, 1), check F.grid_sample for more details.