Skip to content

PointNet++

PointNet++ classification and segmentation models.

First page of PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space

1706.02413 · June 2017

Classes:

PointNet2Encoder

PointNet2Encoder(
    in_channels: int,
    sa_channels: Sequence[
        Sequence[Union[int, Sequence[int]]]
    ],
    *,
    ratios: Optional[Sequence[float]] = None,
    num_points: Optional[Sequence[int]] = None,
    radii: Sequence[Union[float, Sequence[float]]],
    num_neighbors: Sequence[Union[int, Sequence[int]]],
    stem_channels: Optional[int] = None,
    spatial_dim: int = 3,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = False,
    use_pos: bool = True,
    normalize_pos: bool = True,
    pos_first: bool = False,
    pool: PoolLike = "max",
    sort_neighbors: bool = False,
)

Bases: Module

PointNet++ encoder from the paper PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space by Charles R. Qi, Li Yi, Hao Su, Leonidas J. Guibas.

Processes raw point clouds through an optional linear stem followed by multiple Set Abstraction (SA) blocks that progressively downsample the points while learning local features using radius-based grouping. Each SA block can optionally use Multi-Scale Grouping (MSG).

Parameters:

  • in_channels (int) –

    Number of input channels (features per point).

  • sa_channels (Sequence[Sequence[Union[int, Sequence[int]]]]) –

    List of channel configurations for Set Abstraction (SA) blocks. Each element defines the MLP channels for one SA block. For Multi-Scale Grouping (MSG), provide nested lists of channels.

  • ratios (Optional[Sequence[float]], default: None ) –

    Sampling ratios for each SA block (between 0 and 1). Mutually exclusive with num_points.

  • num_points (Optional[Sequence[int]], default: None ) –

    Absolute number of sampled centroids for each SA block (e.g. PointRCNN's fixed \(4096, 1024, \ldots\)). Exactly one of ratios / num_points must be given.

  • radii (Sequence[Union[float, Sequence[float]]]) –

    Search radiuses for each SA block's neighborhood. For MSG, provide a list of radii per block.

  • num_neighbors (Sequence[Union[int, Sequence[int]]]) –

    Max number of neighbors for each SA block. For MSG, provide a list of neighbor counts per block.

  • stem_channels (Optional[int], default: None ) –

    Optional number of channels for initial linear projection.

  • spatial_dim (int, default: 3 ) –

    Spatial dimensionality of point coordinates (e.g. 3 for 3D, 2 for 2D).

  • act (Union[str, Callable, None], default: 'relu' ) –

    Activation function type or callable.

  • act_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the activation function.

  • act_first (bool, default: False ) –

    If True, activation is applied before normalization.

  • norm (Union[str, Callable, None], default: 'batch_norm' ) –

    Normalization layer type or callable.

  • norm_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the normalization layer.

  • bias (bool, default: False ) –

    Whether to use bias in linear layers.

  • use_pos (bool, default: True ) –

    Whether to concatenate per-point relative positions to x.

  • pos_first (bool, default: False ) –

    Concatenate the relative positions before the grouped features (see SAModule).

  • pool (PoolLike, default: 'max' ) –

    Pooling operation for SA blocks.

Attributes:

  • out_channels (int) –

    Output channels of the last SA block.

  • skip_channels (List[int]) –

    Skip-connection channel sizes (stem output + each SA output except the last), ordered

out_channels property

out_channels: int

Output channels of the last SA block.

skip_channels property

skip_channels: List[int]

Skip-connection channel sizes (stem output + each SA output except the last), ordered from finest to coarsest resolution.

PointNet2Decoder

PointNet2Decoder(
    in_channels: int,
    skip_channels: Sequence[int],
    fp_channels: Sequence[Sequence[int]],
    *,
    spatial_dim: int = 3,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = False,
    k: Optional[Union[int, Sequence[int]]] = None,
    weighting: Literal["squared", "inverse"] = "squared",
    eps: float = 1e-16,
)

Bases: Module

PointNet++ decoder (feature propagation) from the paper PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space by Charles R. Qi, Li Yi, Hao Su, Leonidas J. Guibas.

Upsamples features from the encoder back to the original resolution using kNN interpolation and skip connections from encoder intermediates.

Parameters:

  • in_channels (int) –

    Number of input channels from the encoder (or aggregation) output.

  • skip_channels (Sequence[int]) –

    Channel sizes for skip connections at each level, ordered from coarsest to finest resolution.

  • fp_channels (Sequence[Sequence[int]]) –

    List of channel configurations for Feature Propagation (FP) blocks. Each element defines the MLP channels for one FP block.

  • spatial_dim (int, default: 3 ) –

    Spatial dimensionality of point coordinates. Also used as the default number of neighbors k for kNN interpolation in all but the first FP block.

  • act (Union[str, Callable, None], default: 'relu' ) –

    Activation function type or callable.

  • act_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the activation function.

  • act_first (bool, default: False ) –

    If True, activation is applied before normalization.

  • norm (Union[str, Callable, None], default: 'batch_norm' ) –

    Normalization layer type or callable.

  • norm_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the normalization layer.

  • bias (bool, default: False ) –

    Whether to use bias in linear layers.

  • k (Optional[Union[int, Sequence[int]]], default: None ) –

    Number of neighbors for kNN interpolation, per FP block when a sequence. Defaults to 1 for the first (deepest) block and spatial_dim for the remaining blocks.

PointNet2Classification

PointNet2Classification(
    in_channels: int,
    num_classes: int,
    *,
    stem_channels: Optional[int] = None,
    sa_channels: Sequence[
        Sequence[Union[int, Sequence[int]]]
    ],
    aggr_channels: Optional[
        Union[int, Sequence[int]]
    ] = None,
    aggr_use_pos: bool = False,
    head_channels: Optional[
        Union[int, Sequence[int]]
    ] = None,
    ratios: Sequence[float],
    radii: Sequence[Union[float, Sequence[float]]],
    num_neighbors: Sequence[Union[int, Sequence[int]]],
    spatial_dim: int = 3,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = False,
    use_pos: bool = True,
    normalize_pos: bool = True,
    pool: PoolLike = "max",
    dropout: Union[float, Sequence[float]] = 0.0,
    global_pool: PoolLike = "max",
)

Bases: ClassificationModel

PointNet++ classification model from the paper PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space by Charles R. Qi, Li Yi, Hao Su, Leonidas J. Guibas.

This network is a hierarchical point cloud classification model. It processes raw point clouds through a PointNet2Encoder (optional stem + SA blocks), an optional aggregation MLP, global pooling, and a classification head.

Parameters:

  • in_channels (int) –

    Number of input channels (features per point).

  • num_classes (int) –

    Number of output classes.

  • stem_channels (Optional[int], default: None ) –

    Optional number of channels for initial linear projection (inside the encoder).

  • sa_channels (Sequence[Sequence[Union[int, Sequence[int]]]]) –

    List of channel configurations for Set Abstraction (SA) blocks. Each element defines the MLP channels for one SA block. For Multi-Scale Grouping (MSG), provide nested lists of channels.

  • aggr_channels (Optional[Union[int, Sequence[int]]], default: None ) –

    Channel sizes for the post-encoder aggregation MLP.

  • ratios (Sequence[float]) –

    Sampling ratios for each SA block (between 0 and 1).

  • radii (Sequence[Union[float, Sequence[float]]]) –

    Search radiuses for each SA block's neighborhood. For MSG, provide a list of radii per block.

  • num_neighbors (Sequence[Union[int, Sequence[int]]]) –

    Max number of neighbors for each SA block. For MSG, provide a list of neighbor counts per block.

  • spatial_dim (int, default: 3 ) –

    Spatial dimensionality of point coordinates (e.g. 3 for 3D, 2 for 2D).

  • act (Union[str, Callable, None], default: 'relu' ) –

    Activation function type or callable.

  • act_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the activation function.

  • act_first (bool, default: False ) –

    If True, activation is applied before normalization.

  • norm (Union[str, Callable, None], default: 'batch_norm' ) –

    Normalization layer type or callable.

  • norm_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the normalization layer.

  • bias (bool, default: False ) –

    Whether to use bias in linear layers.

  • use_pos (bool, default: True ) –

    Whether to concatenate per-point relative positions to x.

  • pool (PoolLike, default: 'max' ) –

    Pooling operation for SA blocks.

  • dropout (Union[float, Sequence[float]], default: 0.0 ) –

    Dropout for the classification head: a single rate shared by every hidden layer, or one rate per hidden layer.

  • global_pool (PoolLike, default: 'max' ) –

    Global pooling operation.

Methods:

  • configure_encoder –

    Build the PointNet2Encoder backbone.

  • configure_aggr –

    Build the aggregation MLP applied to the encoder output, or None when aggr_channels is unset.

Attributes:

  • num_features (int) –

    Feature dimension \(C\) of the encoder output, after the optional aggregation MLP.

num_features property

num_features: int

Feature dimension \(C\) of the encoder output, after the optional aggregation MLP.

configure_encoder

configure_encoder() -> PointNet2Encoder

Build the PointNet2Encoder backbone.

configure_aggr

configure_aggr() -> Optional[MLP]

Build the aggregation MLP applied to the encoder output, or None when aggr_channels is unset.

PointNet2Segmentation

PointNet2Segmentation(
    in_channels: int,
    num_classes: int,
    *,
    stem_channels: Optional[int] = None,
    sa_channels: Sequence[
        Sequence[Union[int, Sequence[int]]]
    ],
    aggr_channels: Optional[
        Union[int, Sequence[int]]
    ] = None,
    fp_channels: Sequence[Sequence[int]],
    head_channels: Optional[
        Union[int, Sequence[int]]
    ] = None,
    ratios: Sequence[float],
    radii: Sequence[Union[float, Sequence[float]]],
    num_neighbors: Sequence[Union[int, Sequence[int]]],
    spatial_dim: int = 3,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
    act_first: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    bias: bool = False,
    use_pos: bool = True,
    normalize_pos: bool = True,
    pool: PoolLike = "max",
    dropout: float = 0.0,
    skip_input: bool = True,
    fp_k: Optional[Union[int, Sequence[int]]] = None,
)

Bases: SegmentationModel

PointNet++ segmentation model from the paper PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space by Charles R. Qi, Li Yi, Hao Su, Leonidas J. Guibas.

This network is a hierarchical point cloud segmentation model built from a PointNet2Encoder (optional stem + SA blocks), an optional aggregation MLP, a PointNet2Decoder (FP blocks with skip connections), and a per-point classification head.

Parameters:

  • in_channels (int) –

    Number of input channels (features per point).

  • num_classes (int) –

    Number of output classes.

  • stem_channels (Optional[int], default: None ) –

    Optional number of channels for initial linear projection (inside the encoder).

  • sa_channels (Sequence[Sequence[Union[int, Sequence[int]]]]) –

    List of channel configurations for Set Abstraction (SA) blocks. Each element defines the MLP channels for one SA block. For Multi-Scale Grouping (MSG), provide nested lists of channels.

  • aggr_channels (Optional[Union[int, Sequence[int]]], default: None ) –

    Channel sizes for the post-encoder aggregation MLP.

  • fp_channels (Sequence[Sequence[int]]) –

    List of channel configurations for Feature Propagation (FP) blocks. Each element defines the MLP channels for one FP block.

  • ratios (Sequence[float]) –

    Sampling ratios for each SA block (between 0 and 1).

  • radii (Sequence[Union[float, Sequence[float]]]) –

    Search radiuses for each SA block's neighborhood. For MSG, provide a list of radii per block.

  • num_neighbors (Sequence[Union[int, Sequence[int]]]) –

    Max number of neighbors for each SA block. For MSG, provide a list of neighbor counts per block.

  • spatial_dim (int, default: 3 ) –

    Spatial dimensionality of point coordinates (e.g. 3 for 3D, 2 for 2D).

  • act (Union[str, Callable, None], default: 'relu' ) –

    Activation function type or callable.

  • act_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the activation function.

  • act_first (bool, default: False ) –

    If True, activation is applied before normalization.

  • norm (Union[str, Callable, None], default: 'batch_norm' ) –

    Normalization layer type or callable.

  • norm_kwargs (Optional[Dict[str, Any]], default: None ) –

    Additional keyword arguments for the normalization layer.

  • bias (bool, default: False ) –

    Whether to use bias in linear layers.

  • use_pos (bool, default: True ) –

    Whether to concatenate per-point relative positions to x.

  • pool (PoolLike, default: 'max' ) –

    Pooling operation for SA blocks.

  • dropout (float, default: 0.0 ) –

    Dropout rate for classification head.

Methods:

  • configure_encoder –

    Build the PointNet2Encoder backbone.

  • configure_aggr –

    Build the aggregation MLP applied to the encoder output, or None when aggr_channels is unset.

  • configure_decoder –

    Build the PointNet2Decoder upsampling the coarsest features back through the encoder skips.

Attributes:

  • num_features (int) –

    Feature dimension \(C\) of the decoder output.

num_features property

num_features: int

Feature dimension \(C\) of the decoder output.

configure_encoder

configure_encoder() -> PointNet2Encoder

Build the PointNet2Encoder backbone.

configure_aggr

configure_aggr() -> Optional[MLP]

Build the aggregation MLP applied to the encoder output, or None when aggr_channels is unset.

configure_decoder

configure_decoder() -> PointNet2Decoder

Build the PointNet2Decoder upsampling the coarsest features back through the encoder skips.