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:# 在这种情况下,只使用相对坐标 ...
sum(dist_recip, axis=2, keepdim=True) weight = dist_recip / norm interpolated_points = paddle.sum(index_points(points2, idx) * weight.reshape([B, N, 3, 1]), axis=2) if points1 is not None: points1 = points1.transpose([0, 2, 1]) new_points = paddle.concat([points1, ...
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...
剩下的这三块相当的straight forward,应该不必解说,注意返回的是new_xyz新的子集中心点坐标,new_points是对应的特征,idx是包含指向的local region的所有参与运算点的index,其shape为(batch_size, npoint, nsample)。 classification任务 ssg的核心模型 用于cls的ssg核心代码如下: ...
GPU_INDEX = FLAGS.gpu # 默认GPU使用数量MOMENTUM = FLAGS.momentum # 初始学习率OPTIMIZER = FLAGS.optimizer # 优化器DECAY_STEP = FLAGS.decay_step # 衰变步长DECAY_RATE = FLAGS.decay_rate # 衰变率# some code ...# 获取模型pred, end_points = MODEL.get_model(pointclouds_pl, is_training_pl,...
points, target = data points = points.transpose(2,1) points, target = points.cuda(), target.cuda()# 将模型seger设置为评估模式,以确保模型在推理时的行为与训练时不同,例如关闭dropout等seger = seger.eval() pred, _, _ = seger(points) ...
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
points_idx = torch.index_select(points, dim=1, index=idx) if self.group_all: new_xyz = xyz_idx.mean(dim=2, keepdim=True) new_points = points_idx.mean(dim=2) else: new_xyz = xyz_idx[:, :, 0:self.npoint, :] new_points = points_idx[:, :, 0:self.npoint, :] new_points...