Pointnet_Pointnet2_pytorch icon indicating copy to clipboard operation
Pointnet_Pointnet2_pytorch copied to clipboard

A question about forward() of get_model() from pointnet2_part_seg_ssg.py

Open BEFLIPPED opened this issue 9 months ago • 0 comments

I found something from https://github.com/charlesq34/pointnet2/blob/master/models/pointnet2_part_seg.py, as follows.

def get_model(point_cloud, is_training, bn_decay=None):
    """ Part segmentation PointNet, input is BxNx6 (XYZ NormalX NormalY NormalZ), output Bx50 """
    batch_size = point_cloud.get_shape()[0].value
    num_point = point_cloud.get_shape()[1].value
    end_points = {}
    l0_xyz = tf.slice(point_cloud, [0,0,0], [-1,-1,3])
    l0_points = tf.slice(point_cloud, [0,0,3], [-1,-1,3])

Some design in get_model(): forward() in pointnet2_part_seg_ssg.py from https://github.com/yanx27/Pointnet_Pointnet2_pytorch/blob/master/models/pointnet2_part_seg_ssg.py, as follows.

def forward(self, xyz, cls_label):
        # Set Abstraction layers
        B,C,N = xyz.shape
        if self.normal_channel:
            l0_points = xyz
            l0_xyz = xyz[:,:3,:]
        else:
            l0_points = xyz
            l0_xyz = xyz

If pc sent in model has xyz+nxnynz, the following processing may be different in corresponding function, especially in sample_and_group(). Could you please tell me the reason of the different design in pointnet2_part_seg_ssg.py? Whether the forward() is specially designed for pc which solely has xyz or not ?

BEFLIPPED avatar Jan 13 '25 08:01 BEFLIPPED