def __init__(self, num_classes, normal_channel=False):
     super(get_model, self).__init__()
     if normal_channel:
         additional_channel = 3
     else:
         additional_channel = 0
     self.normal_channel = normal_channel
     self.sa1 = PointNetSetAbstraction(npoint=512,
                                       radius=0.2,
                                       nsample=32,
                                       in_channel=6 + additional_channel,
                                       mlp=[64, 64, 128],
                                       group_all=False)
     self.sa2 = PointNetSetAbstraction(npoint=128,
                                       radius=0.4,
                                       nsample=64,
                                       in_channel=128 + 3,
                                       mlp=[128, 128, 256],
                                       group_all=False)
     self.sa3 = PointNetSetAbstraction(npoint=None,
                                       radius=None,
                                       nsample=None,
                                       in_channel=256 + 3,
                                       mlp=[256, 512, 1024],
                                       group_all=True)
     self.fp3 = PointNetFeaturePropagation(in_channel=1280, mlp=[256, 256])
     self.fp2 = PointNetFeaturePropagation(in_channel=384, mlp=[256, 128])
     self.fp1 = PointNetFeaturePropagation(in_channel=128 + 16 + 6 +
                                           additional_channel,
                                           mlp=[128, 128, 128])
     self.conv1 = nn.Conv1d(128, 128, 1)
     self.bn1 = nn.BatchNorm1d(128)
     self.drop1 = nn.Dropout(0.5)
     self.conv2 = nn.Conv1d(128, num_classes, 1)
Exemple #2
0
 def __init__(self, num_class, normal_channel=False):
     super(get_model, self).__init__()
     in_channel = 6 if normal_channel else 3
     self.normal_channel = normal_channel
     # TODO adapt the group numbers (npoint)
     self.sa1 = PointNetSetAbstraction(npoint=32,
                                       radius=0.2,
                                       nsample=4,
                                       in_channel=in_channel,
                                       mlp=[64, 64, 128],
                                       group_all=False)
     self.sa2 = PointNetSetAbstraction(npoint=16,
                                       radius=0.4,
                                       nsample=8,
                                       in_channel=128 + 3,
                                       mlp=[128, 128, 256],
                                       group_all=False)
     self.sa3 = PointNetSetAbstraction(npoint=None,
                                       radius=None,
                                       nsample=None,
                                       in_channel=256 + 3,
                                       mlp=[256, 512, 1024],
                                       group_all=True)
     self.fc1 = nn.Linear(1024, 512)
     self.bn1 = nn.BatchNorm1d(512)
     self.drop1 = nn.Dropout(0.4)
     self.fc2 = nn.Linear(512, 256)
     self.bn2 = nn.BatchNorm1d(256)
     self.drop2 = nn.Dropout(0.4)
     self.fc3 = nn.Linear(256, num_class)
Exemple #3
0
 def __init__(self, num_classes):
     super(PointNet2PartSeg, self).__init__()
     self.sa1 = PointNetSetAbstraction(npoint=512,
                                       radius=0.2,
                                       nsample=64,
                                       in_channel=3,
                                       mlp=[64, 64, 128],
                                       group_all=False)
     self.sa2 = PointNetSetAbstraction(npoint=128,
                                       radius=0.4,
                                       nsample=64,
                                       in_channel=128 + 3,
                                       mlp=[128, 128, 256],
                                       group_all=False)
     self.sa3 = PointNetSetAbstraction(npoint=None,
                                       radius=None,
                                       nsample=None,
                                       in_channel=256 + 3,
                                       mlp=[256, 512, 1024],
                                       group_all=True)
     self.fp3 = PointNetFeaturePropagation(in_channel=1280, mlp=[256, 256])
     self.fp2 = PointNetFeaturePropagation(in_channel=384, mlp=[256, 128])
     self.fp1 = PointNetFeaturePropagation(in_channel=128,
                                           mlp=[128, 128, 128])
     self.conv1 = nn.Conv1d(128, 128, 1)
     self.bn1 = nn.BatchNorm1d(128)
     self.drop1 = nn.Dropout(0.5)
     self.conv2 = nn.Conv1d(128, num_classes, 1)
Exemple #4
0
 def __init__(self, num_classes=40):
     super(PointNet2ClsSsg, self).__init__()
     self.sa1 = PointNetSetAbstraction(npoint=512,
                                       radius=0.2,
                                       nsample=32,
                                       in_channel=3,
                                       mlp=[64, 64, 128],
                                       group_all=False)
     self.sa2 = PointNetSetAbstraction(npoint=128,
                                       radius=0.4,
                                       nsample=64,
                                       in_channel=128 + 3,
                                       mlp=[128, 128, 256],
                                       group_all=False)
     self.sa3 = PointNetSetAbstraction(npoint=None,
                                       radius=None,
                                       nsample=None,
                                       in_channel=256 + 3,
                                       mlp=[256, 512, 1024],
                                       group_all=True)
     self.fc1 = nn.Linear(1024, 512)
     self.bn1 = nn.BatchNorm1d(512)
     self.drop1 = nn.Dropout(0.4)
     self.fc2 = nn.Linear(512, 256)
     self.bn2 = nn.BatchNorm1d(256)
     self.drop2 = nn.Dropout(0.4)
     self.fc3 = nn.Linear(256, num_classes)
Exemple #5
0
 def __init__(self, num_classes, normal_channel=False):
     super(get_model, self).__init__()
     if normal_channel:
         additional_channel = 3
     else:
         additional_channel = 0
     self.normal_channel = normal_channel
     self.sa1 = PointNetSetAbstractionMsg(
         512, [0.1, 0.2, 0.4], [32, 64, 128], 3 + additional_channel,
         [[32, 32, 64], [64, 64, 128], [64, 96, 128]])
     self.sa2 = PointNetSetAbstractionMsg(
         128, [0.4, 0.8], [64, 128], 128 + 128 + 64,
         [[128, 128, 256], [128, 196, 256]])
     self.sa3 = PointNetSetAbstraction(npoint=None,
                                       radius=None,
                                       nsample=None,
                                       in_channel=512 + 3,
                                       mlp=[256, 512, 1024],
                                       group_all=True)
     self.fp3 = PointNetFeaturePropagation(in_channel=1536, mlp=[256, 256])
     self.fp2 = PointNetFeaturePropagation(in_channel=576, mlp=[256, 128])
     self.fp1 = PointNetFeaturePropagation(in_channel=150 +
                                           additional_channel,
                                           mlp=[128, 128])
     self.conv1 = nn.Conv1d(128, 128, 1)
     self.bn1 = nn.BatchNorm1d(128)
     self.drop1 = nn.Dropout(0.5)
     self.conv2 = nn.Conv1d(128, num_classes, 1)
Exemple #6
0
 def __init__(self,
              num_class,
              num_points,
              normal_channel=False,
              decoder=False):
     super(get_model, self).__init__()
     in_channel = 3 if normal_channel else 0
     self.normal_channel = normal_channel
     self.sa1 = PointNetSetAbstractionMsg(
         512, [0.1, 0.2, 0.4], [16, 32, 128], in_channel,
         [[32, 32, 64], [64, 64, 128], [64, 96, 128]])
     self.sa2 = PointNetSetAbstractionMsg(
         128, [0.2, 0.4, 0.8], [32, 64, 128], 320,
         [[64, 64, 128], [128, 128, 256], [128, 128, 256]])
     self.sa3 = PointNetSetAbstraction(None, None, None, 640 + 3,
                                       [256, 512, 1024], True)
     self.fc1 = nn.Linear(1024, 512)
     self.bn1 = nn.BatchNorm1d(512)
     self.drop1 = nn.Dropout(0.4)
     self.fc2 = nn.Linear(512, 256)
     self.bn2 = nn.BatchNorm1d(256)
     self.drop2 = nn.Dropout(0.5)
     self.fc3 = nn.Linear(256, num_class)
     self.decode = decoder
     if self.decode:
         self.decoder = PointDecoder(num_points)
Exemple #7
0
 def __init__(self, num_classes):
     super(get_model, self).__init__()
     self.sa1 = PointNetSetAbstraction(1024, 0.1, 32, 8, [32, 32, 64],
                                       False)
     self.sa2 = PointNetSetAbstraction(256, 0.2, 32, 64 + 3, [64, 64, 128],
                                       False)
     self.sa3 = PointNetSetAbstraction(64, 0.4, 32, 128 + 3,
                                       [128, 128, 256], False)
     self.sa4 = PointNetSetAbstraction(16, 0.8, 32, 256 + 3,
                                       [256, 256, 512], False)
     self.fp4 = PointNetFeaturePropagation(768, [256, 256])
     self.fp3 = PointNetFeaturePropagation(384, [256, 256])
     self.fp2 = PointNetFeaturePropagation(320, [256, 128])
     self.fp1 = PointNetFeaturePropagation(128, [128, 128, 128])
     self.conv1 = nn.Conv1d(128, 128, 1)
     self.bn1 = nn.BatchNorm1d(128)
     self.drop1 = nn.Dropout(0.5)
     self.conv2 = nn.Conv1d(128, num_classes, 1)
Exemple #8
0
 def __init__(self, num_class, normal_channel=True):
     super(get_encoder_model, self).__init__()
     in_channel = 3 if normal_channel else 0
     self.normal_channel = normal_channel
     self.sa1 = PointNetSetAbstractionMsg(
         512, [0.1, 0.2, 0.4], [16, 32, 128], in_channel,
         [[32, 32, 64], [64, 64, 128], [64, 96, 128]])
     self.sa2 = PointNetSetAbstractionMsg(
         128, [0.2, 0.4, 0.8], [32, 64, 128], 320,
         [[64, 64, 128], [128, 128, 256], [128, 128, 256]])
     self.sa3 = PointNetSetAbstraction(None, None, None, 640 + 3,
                                       [256, 512, 1024], True)
     self.fc1 = nn.Linear(1024, 512)
Exemple #9
0
 def __init__(self, num_classes=40):
     super(PointNet2ClsMsg, self).__init__()
     self.sa1 = PointNetSetAbstractionMsg(
         512, [0.1, 0.2, 0.4], [16, 32, 128], 0,
         [[32, 32, 64], [64, 64, 128], [64, 96, 128]])
     self.sa2 = PointNetSetAbstractionMsg(
         128, [0.2, 0.4, 0.8], [32, 64, 128], 320,
         [[64, 64, 128], [128, 128, 256], [128, 128, 256]])
     self.sa3 = PointNetSetAbstraction(None, None, None, 640 + 3,
                                       [256, 512, 1024], True)
     self.fc1 = nn.Linear(1024, 512)
     self.bn1 = nn.BatchNorm1d(512)
     self.drop1 = nn.Dropout(0.4)
     self.fc2 = nn.Linear(512, 256)
     self.bn2 = nn.BatchNorm1d(256)
     self.drop2 = nn.Dropout(0.4)
     self.fc3 = nn.Linear(256, num_classes)
Exemple #10
0
 def __init__(self, num_classes):
     super(PointNet2PartSeg_msg_one_hot, self).__init__()
     self.sa1 = PointNetSetAbstractionMsg(
         512, [0.1, 0.2, 0.4], [32, 64, 128], 0 + 3,
         [[32, 32, 64], [64, 64, 128], [64, 96, 128]])
     self.sa2 = PointNetSetAbstractionMsg(
         128, [0.4, 0.8], [64, 128], 128 + 128 + 64,
         [[128, 128, 256], [128, 196, 256]])
     self.sa3 = PointNetSetAbstraction(npoint=None,
                                       radius=None,
                                       nsample=None,
                                       in_channel=512 + 3,
                                       mlp=[256, 512, 1024],
                                       group_all=True)
     self.fp3 = PointNetFeaturePropagation(in_channel=1536, mlp=[256, 256])
     self.fp2 = PointNetFeaturePropagation(in_channel=576, mlp=[256, 128])
     self.fp1 = PointNetFeaturePropagation(in_channel=150, mlp=[128, 128])
     self.conv1 = nn.Conv1d(128, 128, 1)
     self.bn1 = nn.BatchNorm1d(128)
     self.drop1 = nn.Dropout(0.5)
     self.conv2 = nn.Conv1d(128, num_classes, 1)
	def __init__(self, num_class, num_point, num_channel):
		super(get_model, self).__init__()
		self.sa1 = PointNetSetAbstraction(num_point, 0.1, 32, 3 + 3, [32, 32, 64], False)
		self.sa2 = PointNetSetAbstraction(256, 0.2, 32, 64 + 3, [64, 64, 128], False)
		self.sa3 = PointNetSetAbstraction(64, 0.4, 32, 128 + 3, [128, 128, 256], False)
		self.sa4 = PointNetSetAbstraction(16, 0.8, 32, 256 + 3, [256, 256, 512], False)
		self.fp4 = PointNetFeaturePropagation(768, [256, 256])
		self.fp3 = PointNetFeaturePropagation(384, [256, 256])
		self.fp2 = PointNetFeaturePropagation(320, [256, 128])
		self.fp1 = PointNetFeaturePropagation(128, [128, 128, 128])

		self.sa_other_1 = PointNetSetAbstraction(num_point, 0.1, 32, num_channel - 3, [32, 32, 64], False, concat_norm_xyz = False)
		self.sa_other_2 = PointNetSetAbstraction(256, 0.2, 32, 64, [64, 64, 128], False, concat_norm_xyz = False)
		self.sa_other_3 = PointNetSetAbstraction(64, 0.4, 32, 128, [128, 128, 256], False, concat_norm_xyz = False)
		self.sa_other_4 = PointNetSetAbstraction(16, 0.8, 32, 256, [256, 256, 512], False, concat_norm_xyz = False)
		self.fp_other_4 = PointNetFeaturePropagation(768, [256, 256])
		self.fp_other_3 = PointNetFeaturePropagation(384, [256, 256])
		self.fp_other_2 = PointNetFeaturePropagation(320, [256, 128])
		self.fp_other_1 = PointNetFeaturePropagation(128, [128, 128, 128])

		self.conv1 = nn.Conv1d(256, 256, 1)
		self.bn1 = nn.BatchNorm1d(256)
		self.drop1 = nn.Dropout(0.5)
		self.conv2 = nn.Conv1d(256, num_class, 1)
Exemple #12
0
 def __init__(self, num_class, normal_channel=True):
     super(get_model, self).__init__()
     in_channel = 3 if normal_channel else 0
     self.normal_channel = normal_channel
     self.sa1 = PointNetSetAbstractionMsg(
         512, [0.1, 0.2, 0.4], [16, 32, 128], in_channel,
         [[32, 32, 64], [64, 64, 128], [64, 96, 128]])
     self.sa2 = PointNetSetAbstractionMsg(
         128, [0.2, 0.4, 0.8], [32, 64, 128], 320,
         [[64, 64, 128], [128, 128, 256], [128, 128, 256]])
     self.sa3 = PointNetSetAbstraction(None, None, None, 640 + 3,
                                       [256, 512, 1024], True)
     self.fc1 = nn.Linear(1024, 512)
     self.bn1 = nn.BatchNorm1d(512)
     self.drop1 = nn.Dropout(0.4)
     self.fc2 = nn.Linear(512, 256)
     self.bn2 = nn.BatchNorm1d(256)
     self.drop2 = nn.Dropout(0.5)
     #         self.fc3 = nn.Linear(256, 40)
     # self.encoder = torch.nn.Sequential(*list(self.children())[:-1])
     self.projetion = MLPHead(in_channels=256,
                              mlp_hidden_size=512,
                              projection_size=128)