-
Notifications
You must be signed in to change notification settings - Fork 136
Description
Hi,
Thank you for sharing the source code for your project.
While examining your preprocessing code for the ShapeNet dataset I found that the following code selects the input points to the model (https://github.com/yuxumin/PoinTr/blob/master/utils/misc.py#L191):
distance_matrix = torch.norm(center.unsqueeze(2) - points.unsqueeze(1), p =2 ,dim = -1) # 1 1 2048
idx = torch.argsort(distance_matrix,dim=-1, descending=False)[0,0] # 2048
if padding_zeros:
input_data = points.clone()
input_data[0, idx[:num_crop]] = input_data[0,idx[:num_crop]] * 0
else:
input_data = points.clone()[0, idx[num_crop:]].unsqueeze(0) # 1 N 3
crop_data = points.clone()[0, idx[:num_crop]].unsqueeze(0)
if isinstance(crop,list):
INPUT.append(fps(input_data,2048))
CROP.append(fps(crop_data,2048))
else:
INPUT.append(input_data)
CROP.append(crop_data)
I have a question specifically regarding the following line:
input_data = points.clone()[0, idx[num_crop:]].unsqueeze(0) where we are basically selecting num_points - num_crop farthest points from the selected center instead of selecting num_crop closest points. The AdaPoinTr paper states the following:
In order to mimic the real-world situation, we first randomly select a viewpoint and then remove the n furthest points from the viewpoint to obtain a training partial point cloud.
which I interpreted as selecting 8192 - n points that are closest to the viewpoint (center). What is correct intended behavior for selecting the points?