grouped_points = index_points(points, idx) #dim=-1代表按照最后的维度进行拼接,即相当于dim=3 new_points = torch.cat([grouped_xyz_norm, grouped_points], dim=-1) # [B, npoint, nsample, C+D] else: new_points = grouped_xyz_norm if returnfps: return new_xyz, new_points, grouped_xyz...
grouped_points = index_points(points, idx) # dim=-1代表按照最后的维度进行拼接,即相当于dim=3 new_points = torch.cat([grouped_xyz_norm, grouped_points], dim=-1) # [B, npoint, nsample, C+D] else: new_points = grouped_xyz_norm if returnfps: return new_xyz, new_points, grouped_xy...
grouped_points = index_points(points, group_idx)# 将邻居点的特征 grouped_points 与相对坐标 grouped_xyz 连接在一起,形成新的特征张量。# 新的 grouped_points 的形状为 [B, S, K, D+C]。grouped_points = torch.cat([grouped_points, grouped_xyz], dim=-1)else:# 在这种情况下,只使用相对坐标 ...
def query_ball_point(radius, nsample, xyz, new_xyz): """ Input: radius: local region radius nsample: max sample number in local region xyz: all points, [B, N, 3] new_xyz: query points, [B, S, 3] Return: group_idx: grouped points index, [B, S, nsample] """ device = xy...
points1: input points data, [B, D, N] points2: sampled input points data, [B, D, S] """ B, C, N = xyz1.shape _, D, S = points2.shape # Ball Query knn_idx = pointnet_utils.knn(1, xyz1, xyz2) # You need to implement knn group_points = index_points(points1, knn_...
cfg=config()defindex_points(points, idx):"""Input: points: input points data, [B, N, C] idx: sample index data, [B, S],其中S可以是一个多项式 Return: new_points:, indexed points data, [B, S, C]"""device=points.device
def __getitem__(self, index): point_set = self.scene_points_list[index] semantic_seg = self.semantic_labels_list[index].astype(np.int32) coordmax = np.max(point_set,axis=0) coordmin = np.min(point_set,axis=0) smpmin = np.maximum(coordmax-[1.5,1.5,3.0], coordmin) #(1) smp...
label = np.loadtxt(label_file_path).astype('int')# 如果本身的点少于需要采样的点,则直接去除iflen(point_cloud) < NUM_SAMPLE_POINTS:continue# 采样num_points =len(point_cloud)# 确定随机采样的indexsampled_indices = random.sample(list(range(num_points)), NUM_SAMPLE_POINTS)# 点云采样sampled_...
# Get model and loss pred, end_points = MODEL.get_model(pointclouds_pl, is_training_pl, bn_decay=bn_decay) loss = MODEL.get_loss(pred, labels_pl, end_points) tf.summary.scalar('loss', loss) #tf.argmax(pred, 2) 返回pred C 这个维度的最大值索引 #tf.equal() 比较两个张量对应...
point_set = self.scene_points_list[index]semantic_seg = self.semantic_labels_list[index].astype(np.int32)coordmax = np.max(point_set,axis=0)coordmin = np.min(point_set,axis=0)smpmin = np.maximum(coordmax-[1.5,1.5,3.0], coordmin) #(1)smpmin[2] = coordmin[2]smpsz = np...