ma-xu / pointMLP-pytorch

[ICLR 2022 poster] Official PyTorch implementation of "Rethinking Network Design and Local Geometry in Point Cloud: A Simple Residual MLP Framework"
Apache License 2.0
501 stars 65 forks source link

Understanding the index_points function.. #53

Closed aspaul20 closed 2 years ago

aspaul20 commented 2 years ago

Hi, thank you for your work. I am trying to understand your code and until KNN it all makes good sense. However, I don't fully understand the working of the index_points(points, idx) function.

Q1: What is its purpose and how does it work?

Q2: Specifically, the following line: new_points = points[batch_indices, idx, :] Does it update the old points with new indices that are of the k-nearest neighbors?

Any help would be appreciated. Thanks a lot.

ma-xu commented 2 years ago

@Amur-Pal Thanks for your interest.

Q1: What is its purpose and how does it work?

A1: index_points function finds and returns the sampled data. See the explanations here: https://github.com/ma-xu/pointMLP-pytorch/blob/b5dcf4d0ca2085d10fe1dc5e6f2972cddec8399d/classification_ModelNet40/models/pointmlp.py#L53

Q2: Does it update the old points with new indices that are of the k-nearest neighbors?

A2: No, we directly return a new tensor new_points. This function is only used to index points and return indexed points.

Please let me know if you have any further questions or concerns.

aspaul20 commented 2 years ago

Great, thank you for the clarification and quick response. Have a good day.