ma-xu/pointMLP-pytorch

Questions about Local Grouper

aspaul20 opened this issue · 4 comments

Hi, I hope you are well. I am back with a couple of more questions about your code, hopefully you don't mind.

According to my understanding, the local grouper function takes in the point cloud and its corresponding feature vector, applies a transformation on it, and returns the new cloud with its new feature map (xyz and new_xyz being the cloud, with points and new_points being the features?)

Is this correct, and why does Line#333 show that xyz is just a permuted version of x? I'm very confused so would appreciate any help on how this function works.
Thanks a lot once again.

ma-xu commented

Hi @aspaul20 Sure, feel free to ask any question about PointMLP.

  1. Yes.
  2. I assume you are talking about Line#338 according to the link. In Line 335, the shape of x is [batch_size, channel_number, points_number]. However, the seconf input of class LocalGrouper requires a shape of [batch_size, points_number, batch_size, channel_number, points_number]. That is why we use permute function.

A trick to better understand the code is to debug the codes step by step and mark the tensor shape. You can directly run the model and debug it since we provide a very simple example here. Hope this trick can help you.

Thanks @ma-xu for replying. Can you please tell me the difference between x and xyz then? Why do we use the first input xyz to find the k-nearest neighbor indices (and use them to get the KNN of x later), since x is the feature map we're interested in that will be propagated for feature extraction? Do we need xyz at all if use_xyz = False? Thanks again for the help.

ma-xu commented

@aspaul20

x is feature map and xyz is the original coordinates.

k-nearest is based on coordinates, that's why we need xyz.

Do we need xyz at all if use_xyz = False? We still need it for LocalGrouper. use_xyz means if we will add xyz to x.

ma-xu commented

@aspaul20 I will close this issue since no further discussions. Feel free to reopen it if necessary.