def __init__(self, num_classes, point_blocks, cloud_blocks, extra_feature_channels, width_multiplier=1, voxel_resolution_multiplier=1): super().__init__() self.in_channels = extra_feature_channels + 3 self.num_classes = num_classes layers, channels_point, _ = create_pointnet_components( blocks=point_blocks, in_channels=self.in_channels, with_se=False, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier) self.point_features = nn.Sequential(*layers) layers, channels_cloud, _ = create_pointnet_components( blocks=cloud_blocks, in_channels=channels_point, with_se=False, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier) self.cloud_features = nn.Sequential(*layers) layers, _ = create_mlp_components( in_channels=(channels_point + channels_cloud + num_classes), out_channels=[512, 256, 128, 128, 0.5, 2], classifier=True, dim=2, width_multiplier=width_multiplier) self.classifier = nn.Sequential(*layers)
def __init__(self, num_classes, num_shapes, extra_feature_channels=3, width_multiplier=1, voxel_resolution_multiplier=1): super().__init__() assert extra_feature_channels >= 0 self.in_channels = extra_feature_channels + 3 self.num_shapes = num_shapes layers, channels_point, concat_channels_point = create_pointnet_components( blocks=self.blocks, in_channels=self.in_channels, with_se=True, normalize=False, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier) self.point_features = nn.ModuleList(layers) layers, _ = create_mlp_components( in_channels=(num_shapes + channels_point + concat_channels_point), out_channels=[256, 0.2, 256, 0.2, 128, num_classes], classifier=True, dim=2, width_multiplier=width_multiplier) self.classifier = nn.Sequential(*layers)
def __init__(self, num_classes, extra_feature_channels=6, width_multiplier=1): super().__init__() self.in_channels = extra_feature_channels + 3 layers, channels_point, _ = create_pointnet_components( blocks=self.blocks, in_channels=self.in_channels, width_multiplier=width_multiplier) self.point_features = nn.Sequential(*layers) layers, channels_cloud = create_mlp_components( in_channels=channels_point, out_channels=[256, 128], classifier=False, dim=1, width_multiplier=width_multiplier) self.cloud_features = nn.Sequential(*layers) layers, _ = create_mlp_components( in_channels=(channels_point + channels_cloud), out_channels=[512, 256, 0.3, num_classes], classifier=True, dim=2, width_multiplier=width_multiplier) self.classifier = nn.Sequential(*layers)
def __init__(self, num_classes=3, extra_feature_channels=1, num_heading_angle_bins=12, num_size_templates=8, width_multiplier=1, voxel_resolution_multiplier=1): super(BoxEstimationSimpleDanNet, self).__init__() self.in_channels = 3 self.num_classes = num_classes blocks = ((128, 2, None), (256, 1, None), (512, 1, None)) layers, channels_point, _ = create_pointnet_components( blocks=blocks, in_channels=self.in_channels, with_se=False, normalize=True, eps=1e-15, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier ) self.g = nn.Sequential(*layers) layers, _ = create_mlp_components( in_channels=channels_point + num_classes, out_channels=[512, 256, (3 + num_heading_angle_bins * 2 + num_size_templates * 4)], classifier=True, dim=1, width_multiplier=width_multiplier ) self.c1 = nn.Sequential(*layers) layers, _ = create_mlp_components( in_channels=channels_point + num_classes, out_channels=[512, 256, (3 + num_heading_angle_bins * 2 + num_size_templates * 4)], classifier=True, dim=1, width_multiplier=width_multiplier ) self.c2 = nn.Sequential(*layers)
def __init__(self, num_classes, blocks, num_heading_angle_bins, num_size_templates, width_multiplier=1, voxel_resolution_multiplier=1): super().__init__() self.in_channels = 3 self.num_classes = num_classes layers, channels_point, _ = create_pointnet_components( blocks=blocks, in_channels=self.in_channels, with_se=False, normalize=True, eps=1e-15, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier) self.features = nn.Sequential(*layers) layers, _ = create_mlp_components( in_channels=channels_point + num_classes, out_channels=[ 512, 256, (3 + num_heading_angle_bins * 2 + num_size_templates * 4) ], classifier=True, dim=1, width_multiplier=width_multiplier) self.classifier = nn.Sequential(*layers)
def __init__(self, num_classes, extra_feature_channels=7, width_multiplier=1, voxel_resolution_multiplier=2): super().__init__() self.in_channels = extra_feature_channels + 3 layers, channels_point, concat_channels_point = create_pointnet_components( blocks=self.blocks, in_channels=self.in_channels, with_se=False, eps=1e-17, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier) self.point_features = nn.ModuleList(layers) layers, channels_cloud = create_mlp_components( in_channels=channels_point, out_channels=[256, 128], classifier=False, dim=1, width_multiplier=width_multiplier) self.cloud_features = nn.Sequential(*layers) layers, _ = create_mlp_components( in_channels=(concat_channels_point + channels_cloud), out_channels=[512, 0.3, 256, 0.3, num_classes], classifier=True, dim=2, width_multiplier=width_multiplier) self.classifier = nn.Sequential(*layers)
def __init__(self, num_classes, width_multiplier=1, voxel_resolution_multiplier=1): super(PointnetG, self).__init__() self.trans_net1 = transform_net(3, 3) blocks1 = ((64, 3, None),) blocks2 = ((256, 1, None), (512, 1, None)) self.in_channels = 3 self.num_classes = num_classes layers, channels_point, _ = create_pointnet_components( blocks=blocks1, in_channels=self.in_channels, with_se=False, normalize=True, eps=1e-15, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier ) self.pre = nn.Sequential(*layers) self.node = adapt_layer_off(trans_dim_in=channels_point, trans_dim_out=channels_point, fc_dim=channels_point) layers, channels_point, _ = create_pointnet_components( blocks=blocks2, in_channels=2*channels_point, with_se=False, normalize=True, eps=1e-15, width_multiplier=width_multiplier, voxel_resolution_multiplier=voxel_resolution_multiplier ) self.features = nn.Sequential(*layers) self.channels_point = channels_point