Closed linhaojia13 closed 1 year ago
These indices are the result of farthest point sampling (FPS). In short, given N anchor points and K free points, this algorithm searches the K free points to find the point with maximum distance from any anchor point. Think of it as max_k(min_n(d(k, n))).
In a single run, the internal PointNet++ function that computes FPS starts from the same point, so its solution is deterministic. It returns the indices starting from the first point and then appends the next point as described above. As a result, if its solution for N1 is X, its solution for N2 < N1 is X[:N2]. We exploit this to easily compute the indices without having to call the FPS function again (which will return an identity range since the points form a solution already).
Oh, I see what you mean! Thank you very much!
In the models/backbone_module.py, you select the first 1024 out of 2048
sa1_inds
asfp2_inds
. I can understand that the intention behind this is to obtain the indices of these 1024 seed points in the entire point cloud, in order to participate in the loss calculation in the functioncompute_points_obj_cls_loss_hard_topk
(which is in models/losses.py).However, directly selecting the first 1024 out of 2048
sa1_inds
does not correspond one-to-one withfp2_xyz
. This mismatch would causeeuclidean_dist1
andobject_assignment_one_hot variables
in the functioncompute_points_obj_cls_loss_hard_topk
to not be aligned one-to-one. Doesn't this introduce an error in the supervision signal for KPS?models/backbone_module.py:
models/losses.py: