autonomousvision / convolutional_occupancy_networks

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

why normalize_3d_coordiante is needed? #34

Closed qiminchen closed 3 years ago

qiminchen commented 3 years ago

Hi, I'm wondering why normalize_3d_coordiante is needed if the point coordinate is in range of [-0.5, 0.5]? https://github.com/autonomousvision/convolutional_occupancy_networks/blob/f44d413f8d455657a44c24d06163934c69141a09/src/encoder/voxels.py#L74

pengsongyou commented 3 years ago

Hi @qiminchen,

If you check https://github.com/autonomousvision/convolutional_occupancy_networks/blob/f44d413f8d455657a44c24d06163934c69141a09/src/common.py#L260 you can notice that we normalize the coordinates to the range of [0, 1] with the padding as well (since we define the entire 3D space in the range of [-0.55, 0.55]). With the normalized coordintes, we can easily calculate the indices, which is later used for scatter_mean operation.

Hope it answers your questions.

qiminchen commented 3 years ago

thanks, that makes sense, is there any specific reason you define the 3d space in the range of [-0.55, 0.55]? If the 3d space is in the range of [-0.5, 0.5] (which I guess it's more common?), padding should be set to 0, right?

pengsongyou commented 3 years ago

thanks, that makes sense, is there any specific reason you define the 3d space in the range of [-0.55, 0.55]? If the 3d space is in the range of [-0.5, 0.5] (which I guess it's more common?), padding should be set to 0, right?

We were using the ShapeNet data processed and provided by Occupancy Networks, where they define the 3D space in the range of [-0.55, 0.55], so we simply followed it. You are right, if your space is in the range of [-0.5, 0.5], then you can set padding to 0.

qiminchen commented 3 years ago

great, thank you