RandLA-Net-pytorch icon indicating copy to clipboard operation
RandLA-Net-pytorch copied to clipboard

Knn algorithm

Open hanjungwoo1 opened this issue 4 years ago • 3 comments

can i get a knn algorithm in model.py as import and line 172.

I have a several promblems on import torch_points_kernels and torch_points.

hanjungwoo1 avatar Feb 05 '21 06:02 hanjungwoo1

I have the same problem ,too .have you solved it ?

AGI-Mkz avatar Mar 13 '21 12:03 AGI-Mkz

def knn(pos_support, pos, k): """Dense knn serach Arguments: pos_support - [B,N,3] support points pos - [B,M,3] centre of queries k - number of neighboors, needs to be > N Returns: idx - [B,M,k] dist2 - [B,M,k] squared distances """ dist_all = [] points_all = [] for x, y in zip(pos_support, pos): kdtree = KDTree(x) dist, points = kdtree.query(y, k)

    dist_all.append(dist)
    points_all.append(points)

return torch.tensor(points_all, dtype=torch.int64, device='cuda'), torch.tensor(dist_all, dtype=torch.float64,
                                                                                device='cuda')

hanjungwoo1 avatar Mar 15 '21 05:03 hanjungwoo1

I met the same issue that can't find the knn function, silly me. The solution: pip install torch-points-kernels https://github.com/torch-points3d/torch-points-kernels

cctt126 avatar Sep 25 '21 07:09 cctt126