PointCNN
PointCNN classification and segmentation models.

Classes:
-
PointCNNIntermediate–Per-stage encoder features and the point cloud they live on, consumed as decoder skips.
-
PointCNNEncoderBlock–Optional FPS downsampling followed by an
XConvover the kNN graph of the sampled points. -
PointCNNDecoderBlock–Upsamples features to the skip resolution with an
XConv, then fuses them with the skip features via an MLP. -
PointCNNEncoder–Stack of
PointCNNEncoderBlockunits that progressively decimate the cloud with FPS. -
PointCNNDecoder–Stack of
PointCNNDecoderBlockunits that walk the encoder intermediates back to full resolution. -
PointCNNClassification–Classification model as described in the paper
-
PointCNNSegmentation–Segmentation model as described in the paper
PointCNNIntermediate
¶
Bases: NamedTuple
Per-stage encoder features and the point cloud they live on, consumed as decoder skips.
PointCNNEncoderBlock
¶
PointCNNEncoderBlock(
in_channels: int,
out_channels: int,
spatial_dim: int,
kernel_size: int,
hidden_channels: Optional[int] = None,
dilation: int = 1,
bias: bool = True,
act: Union[str, Callable, None] = "relu",
act_kwargs: Optional[Dict[str, Any]] = None,
downsample: Optional[
Callable[[Tensor, Tensor], Tensor]
] = None,
)
Bases: Module
Optional FPS downsampling followed by an XConv over the kNN graph of the sampled points.
PointCNNDecoderBlock
¶
PointCNNDecoderBlock(
in_channels: int,
skip_channels: int,
out_channels: int,
spatial_dim: int,
kernel_size: int,
hidden_channels: Optional[int] = None,
dilation: int = 1,
bias: bool = True,
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,
)
Bases: Module
Upsamples features to the skip resolution with an XConv, then fuses them with the skip features via an MLP.
PointCNNEncoder
¶
PointCNNEncoder(
channels: Sequence[int],
kernel_sizes: Sequence[int],
spatial_dim: int,
ratios: Sequence[float],
hidden_channels: Optional[
Union[int, Sequence[int]]
] = None,
dilations: Sequence[int] = (1, 1, 1, 1),
bias: bool = True,
act: Union[str, Callable, None] = "relu",
act_kwargs: Optional[Dict[str, Any]] = None,
)
Bases: Module
Stack of PointCNNEncoderBlock units that progressively decimate the cloud with FPS.
A stage with a ratio of 0 keeps every point and only transforms features. When
return_intermediates=True is passed to forward, the pre-downsampling features of each
decimating stage are returned in coarse-to-fine order for PointCNNDecoder.
PointCNNDecoder
¶
PointCNNDecoder(
channels: Sequence[int],
skip_channels: Sequence[int],
kernel_sizes: Sequence[int],
spatial_dim: int,
hidden_channels: Optional[
Union[int, Sequence[int]]
] = None,
dilations: Union[int, Sequence[int]] = 1,
bias: bool = True,
act: Union[str, Callable, None] = "relu",
act_kwargs: Optional[Dict[str, Any]] = None,
)
Bases: Module
Stack of PointCNNDecoderBlock units that walk the encoder intermediates back to full resolution.
PointCNNClassification
¶
PointCNNClassification(
in_channels: int,
num_classes: int,
*,
spatial_dim: int = 3,
channels: Sequence[int],
kernel_sizes: Sequence[int],
ratios: Sequence[float],
hidden_channels: Optional[
Union[int, Sequence[int]]
] = None,
dilations: Sequence[int] = (1, 1, 1, 1),
bias: bool = True,
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,
dropout: float = 0.0,
head_channels: Optional[
Union[int, Sequence[int]]
] = None,
global_pool: PoolLike = "max",
)
Bases: ClassificationModel
Classification model as described in the paper "PointCNN: Convolution On X-Transformed Points" by Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, Baoquan Chen.
This classification model consists of a encoder of XConv layers and FPS downsampling layers, and a MLP classification head.
Methods:
-
configure_encoder–Build the
PointCNNEncoderbackbone.
Attributes:
-
num_features(int) –Feature dimension \(C\) of the features entering the head.
PointCNNSegmentation
¶
PointCNNSegmentation(
in_channels: int,
num_classes: int,
*,
spatial_dim: int = 3,
channels: Sequence[int],
hidden_channels: Optional[
Union[int, Sequence[int]]
] = None,
kernel_sizes: Sequence[int],
dilations: Sequence[int] = (1, 1, 1, 1),
ratios: Sequence[float],
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 = True,
dropout: float = 0.0,
head_channels: Optional[
Union[int, Sequence[int]]
] = None,
)
Bases: SegmentationModel
Segmentation model as described in the paper "PointCNN: Convolution On X-Transformed Points" by Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, Baoquan Chen.
An encoder of XConv layers with FPS downsampling, a decoder of XConv layers upsampling back to the skip resolutions, and a per-point MLP head.
Methods:
-
configure_encoder–Build the
PointCNNEncoderbackbone. -
configure_decoder–Build the
PointCNNDecoder, mirroring the decimating encoder stages in reverse.
Attributes:
-
num_features(int) –Feature dimension \(C\) of the decoder output.
configure_decoder
¶
configure_decoder() -> PointCNNDecoder
Build the PointCNNDecoder, mirroring the decimating encoder stages in reverse.