pointnext
PointNeXt classification and segmentation models.

Classes:
-
PointNeXtEncoderBlockβOne encoder stage: an optional set-abstraction downsampling followed by
depthinverted residual blocks. -
PointNeXtEncoderβStack of
PointNeXtEncoderBlockstages, each preceded by a set-abstraction downsampling. -
PointNeXtDecoderβThe PointNeXt decoder, using the Feature Propagation (FP) module from the PointNet++ architecture.
-
PointNeXtPartDecoderβPointNeXt decoder for part segmentation (ShapeNetPart).
-
PointNeXtPartSegmentationβPointNeXt part segmentation model for ShapeNetPart.
-
PointNeXtClassificationβPointNeXt classification model as described in the paper
-
PointNeXtSegmentationβPointNeXt segmentation model as described in the paper
PointNeXtEncoderBlock [source] ΒΆ
PointNeXtEncoderBlock(
spatial_dim: int,
channels: int,
depth: int,
expansion: int,
radius: float,
num_neighbors: int,
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: Union[bool, List[bool]] = True,
add_self_loops: bool = False,
aggr: AggrType = "max",
downsample: Optional[PointNeXtSetAbstraction] = None,
)
Bases: Module
One encoder stage: an optional set-abstraction downsampling followed by depth inverted residual blocks.
PointNeXtEncoder [source] ΒΆ
PointNeXtEncoder(
channels: Sequence[int],
*,
spatial_dim: int = 3,
depths: Sequence[int],
expansion: Union[int, Sequence[int]] = 4,
ratios: Sequence[float],
radiuses: Sequence[Union[float, Sequence[float]]],
num_neighbors: Sequence[Union[int, Sequence[int]]],
sa_layers: int = 1,
sa_use_res: 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,
bias: Union[bool, List[bool]] = True,
add_self_loops: bool = False,
aggr: AggrType = "max",
)
Bases: Module
Stack of PointNeXtEncoderBlock stages, each preceded by a set-abstraction downsampling.
When return_intermediates=True is passed to forward, the pre-downsampling features of every stage are returned in fine-to-coarse order, ready to be consumed as decoder skips.
Note
radiuses and num_neighbors hold one entry per channel: entry \(i\) configures the set-abstraction of block \(i\) and entry \(i+1\) its residual blocks.
Parameters:
-
channels(Sequence[int]) βChannels of the stem output followed by the output of each encoder block.
-
spatial_dim(int, default:3) βSpatial dimension of the input point cloud.
-
depths(Sequence[int]) βNumber of residual blocks in each encoder block.
-
expansion(Union[int, Sequence[int]], default:4) βBottleneck expansion factor of the residual blocks.
-
ratios(Sequence[float]) βSampling ratio of the set-abstraction preceding each encoder block.
-
radiuses(Sequence[Union[float, Sequence[float]]]) βBall-query radius for each channel level.
-
num_neighbors(Sequence[Union[int, Sequence[int]]]) βMaximum number of neighbors for each channel level.
-
sa_layers(int, default:1) βNumber of MLP layers inside each set-abstraction.
-
sa_use_res(bool, default:True) βWhether the set-abstractions use a residual connection.
-
act(Union[str, Callable, None], default:'relu') βActivation function to use for the encoder blocks.
-
act_kwargs(Optional[Dict[str, Any]], default:None) βKeyword arguments for the activation function.
-
act_first(bool, default:False) βWhether to apply the activation function before the normalization.
-
norm(Union[str, Callable, None], default:'batch_norm') βNormalization function to use for the encoder blocks.
-
norm_kwargs(Optional[Dict[str, Any]], default:None) βKeyword arguments for the normalization function.
-
bias(Union[bool, List[bool]], default:True) βWhether to use a bias for the encoder blocks.
-
add_self_loops(bool, default:False) βWhether the neighborhood graphs include self-loops.
-
aggr(AggrType, default:'max') βAggregation used to pool neighbor features.
PointNeXtDecoder [source] ΒΆ
PointNeXtDecoder(
channels: Sequence[int],
skip_channels: Sequence[int],
depths: Sequence[int],
*,
spatial_dim: int = 3,
dropout: float = 0.0,
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: Union[bool, List[bool]] = True,
plain_last: bool = True,
)
Bases: Module
The PointNeXt decoder, using the Feature Propagation (FP) module from the PointNet++ architecture.
Note
The number of channels should be equal to the number of decoder blocks + 1.
Parameters:
-
channels(Sequence[int]) βList of channels for each FP block. The first element should correspond to the last channel of the encoder.
-
skip_channels(Sequence[int]) βList of channels for the skip connections. This is usually the same as the first \(N-1\) channels of the encoder, in reverse order.
-
depths(Sequence[int]) βList of depths for each FP block.
-
spatial_dim(int, default:3) βSpatial dimension of the input point cloud.
-
dropout(float, default:0.0) βDropout rate before the classification head.
-
act(Union[str, Callable, None], default:'relu') βActivation function to use for the FP blocks.
-
act_kwargs(Optional[Dict[str, Any]], default:None) βKeyword arguments for the activation function.
-
act_first(bool, default:False) βWhether to apply the activation function before the normalization.
-
norm(Union[str, Callable, None], default:'batch_norm') βNormalization function to use for the FP blocks.
-
norm_kwargs(Optional[Dict[str, Any]], default:None) βKeyword arguments for the normalization function.
-
bias(Union[bool, List[bool]], default:True) βWhether to use a bias for the FP blocks.
PointNeXtPartDecoder [source] ΒΆ
PointNeXtPartDecoder(
channels: Sequence[int],
skip_channels: Sequence[int],
depths: Sequence[int],
*,
global_conv1_in: int,
global_conv2_in: int,
num_categories: int = 16,
spatial_dim: int = 3,
dropout: float = 0.0,
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: Union[bool, List[bool]] = True,
plain_last: bool = True,
)
Bases: Module
PointNeXt decoder for part segmentation (ShapeNetPart).
Uses the same FP block layout as PointNeXtDecoder, with two global feature convolutions and shape-category conditioning. At the shallowest decoder stage, the skip features are augmented with max-pooled global features from two encoder levels and a shape-category one-hot vector before the FP layer.
This matches the reference PointNextPartDecoder with cls_map='curvenet'.
Parameters:
-
channels(Sequence[int]) βList of channels for each FP block.
-
skip_channels(Sequence[int]) βList of channels for the skip connections.
-
depths(Sequence[int]) βList of depths for each FP block.
-
global_conv1_in(int) βInput channels for global_conv1 (typically
encoder_channels[-2]). -
global_conv2_in(int) βInput channels for global_conv2 (typically
encoder_channels[-1]). -
num_categories(int, default:16) βNumber of shape categories (16 for ShapeNetPart).
PointNeXtPartSegmentation [source] ΒΆ
PointNeXtPartSegmentation(
in_channels: int,
num_classes: int,
*,
num_categories: int,
stem_channels: Optional[
Union[int, Sequence[int]]
] = None,
stem_plain_last: bool = False,
encoder_channels: Sequence[int],
encoder_depths: Sequence[int],
encoder_expansion: Union[int, Sequence[int]] = 4,
sa_layers: int = 1,
sa_use_res: bool = True,
decoder_channels: Sequence[int],
decoder_depths: Sequence[int],
decoder_plain_last: bool = True,
ratios: Sequence[float],
radiuses: Sequence[Union[float, Sequence[float]]],
num_neighbors: Sequence[Union[int, Sequence[int]]],
add_self_loops: bool = False,
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: Union[bool, List[bool]] = True,
dropout: float = 0.0,
head_channels: Optional[Sequence[int]] = None,
)
Bases: PartSegmentationModel
PointNeXt part segmentation model for ShapeNetPart.
Uses the same encoder as PointNeXtSegmentation but replaces the decoder with PointNeXtPartDecoder (global feature conditioning on shape category) and adds a head with global max+avg pooling.
Parameters:
-
in_channels(int) βNumber of input feature channels.
-
num_classes(int) βNumber of part classes (50 for ShapeNetPart).
-
num_categories(int) βNumber of shape categories (16 for ShapeNetPart).
-
stem_channels(Optional[Union[int, Sequence[int]]], default:None) βStem MLP channel sizes.
-
encoder_channels(Sequence[int]) βEncoder channel dimensions per stage.
-
encoder_depths(Sequence[int]) βResidual block depths per encoder stage.
-
encoder_expansion(Union[int, Sequence[int]], default:4) βInvResMLP expansion ratio.
-
sa_layers(int, default:1) βNumber of SA conv layers per block.
-
sa_use_res(bool, default:True) βWhether SA blocks use residual connections.
-
decoder_channels(Sequence[int]) βDecoder channel dimensions per stage.
-
decoder_depths(Sequence[int]) βFP block depths per decoder stage.
-
ratios(Sequence[float]) βFPS downsampling ratios.
-
radiuses(Sequence[Union[float, Sequence[float]]]) βBall-query radii.
-
num_neighbors(Sequence[Union[int, Sequence[int]]]) βMax neighbors per ball query.
Methods:
-
configure_stemβBuild the stem MLP lifting the input features, or
Nonewhenstem_channelsis unset. -
configure_encoderβBuild the
PointNeXtEncoderbackbone. -
configure_decoderβBuild the
PointNeXtPartDecoderupsampling the coarsest features back through the encoder skips.
Attributes:
-
num_features(int) βChannel count \(C\) entering the head: decoder features concatenated with their global max and mean pools.
num_features property ΒΆ
Channel count \(C\) entering the head: decoder features concatenated with their global max and mean pools.
configure_stem [source] ΒΆ
Build the stem MLP lifting the input features, or None when stem_channels is unset.
configure_encoder [source] ΒΆ
configure_encoder() -> PointNeXtEncoder
Build the PointNeXtEncoder backbone.
configure_decoder [source] ΒΆ
configure_decoder() -> PointNeXtPartDecoder
Build the PointNeXtPartDecoder upsampling the coarsest features back through the encoder skips.
PointNeXtClassification [source] ΒΆ
PointNeXtClassification(
in_channels: int,
num_classes: int,
*,
stem_channels: Optional[
Union[int, Sequence[int]]
] = None,
stem_plain_last: bool = False,
encoder_channels: Sequence[int],
encoder_depths: Sequence[int],
encoder_expansion: Union[int, Sequence[int]] = 4,
sa_layers: int = 1,
sa_use_res: bool = True,
ratios: Sequence[float],
radiuses: Sequence[Union[float, Sequence[float]]],
num_neighbors: Sequence[Union[int, Sequence[int]]],
add_self_loops: bool = False,
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: Union[bool, List[bool]] = True,
dropout: float = 0.0,
global_pool: PoolLike = "max",
head_channels: Optional[Sequence[int]] = None,
global_sa_channels: Optional[Sequence[int]] = None,
)
Bases: ClassificationModel
PointNeXt classification model as described in the paper PointNeXt: Revisiting PointNet++ with Improved Training and Scaling Strategies by Guocheng Qian, Yuchen Li, Houwen Peng, Jinjie Mai, Hasan Abed Al Kader Hammoud, Mohamed Elhoseiny, Bernard Ghanem.
PointNeXt modernizes PointNet++ through improved training strategies and architectural enhancements, achieving state-of-the-art performance while maintaining efficiency. The model introduces Inverted Residual MLP (InvResMLP) blocks, separable MLPs, and relative position normalization to enable effective model scaling.
Parameters:
-
in_channels(int) βNumber of input channels (typically 3 for XYZ coordinates, or 6 for XYZ + RGB, or more with additional features like normal).
-
num_classes(int) βNumber of output classes for classification.
-
stem_channels(Optional[Union[int, Sequence[int]]], default:None) βNumber of channels in the stem MLP layer(s) that map input to higher dimension. If None, no stem is used.
-
encoder_channels(Sequence[int]) βChannel dimensions for each encoder block. The number of channels should be equal to the number of blocks + 1.
-
encoder_depths(Sequence[int]) βNumber of blocks in each encoder stage after the initial SA block.
-
encoder_expansion(Union[int, Sequence[int]], default:4) βExpansion ratio to determine the hidden channels of the encoder blocks.
-
ratios(Sequence[float]) βDownsampling sampling ratios for each encoder stage. The number of ratios should be equal to the number of blocks.
-
radiuses(Sequence[Union[float, Sequence[float]]]) βQuery radius for neighborhood grouping in each stage. The number of radiuses should be equal to the number of blocks + 1.
-
num_neighbors(Sequence[Union[int, Sequence[int]]]) βMaximum number of neighbors for each encoder stage. The number of num_neighbors should be equal to the number of blocks + 1.
-
add_self_loops(bool, default:False) βWhether to include the center point as its own neighbor in grouping operations.
-
spatial_dim(int, default:3) βSpatial dimensionality of point clouds (typically 3).
-
act(Union[str, Callable, None], default:'relu') βActivation function.
-
act_kwargs(Optional[Dict[str, Any]], default:None) βAdditional arguments for the activation function.
-
act_first(bool, default:False) βWhether to apply activation before normalization.
-
norm(Union[str, Callable, None], default:'batch_norm') βNormalization layer type.
-
norm_kwargs(Optional[Dict[str, Any]], default:None) βAdditional arguments for normalization layer.
-
bias(Union[bool, List[bool]], default:True) βWhether to use bias in linear / MLP layers.
-
dropout(float, default:0.0) βDropout probability before the classification head.
-
global_pool(PoolLike, default:'max') βGlobal pooling operation for final feature aggregation.
Methods:
-
configure_stemβBuild the stem MLP lifting the input features, or
Nonewhenstem_channelsis unset. -
configure_encoderβBuild the
PointNeXtEncoderbackbone. -
configure_global_saβBuild the shared MLP over
cat([pos, x])applied before pooling, orNonewhenglobal_sa_channelsis unset.
Attributes:
-
num_features(int) βFeature dimension \(C\) fed to the classification head, after the optional global set-abstraction.
num_features property ΒΆ
Feature dimension \(C\) fed to the classification head, after the optional global set-abstraction.
configure_stem [source] ΒΆ
Build the stem MLP lifting the input features, or None when stem_channels is unset.
configure_encoder [source] ΒΆ
configure_encoder() -> PointNeXtEncoder
Build the PointNeXtEncoder backbone.
PointNeXtSegmentation [source] ΒΆ
PointNeXtSegmentation(
in_channels: int,
num_classes: int,
*,
stem_channels: Optional[
Union[int, Sequence[int]]
] = None,
stem_plain_last: bool = False,
encoder_channels: Sequence[int],
encoder_depths: Sequence[int],
encoder_expansion: Union[int, Sequence[int]] = 4,
sa_layers: int = 1,
sa_use_res: bool = True,
decoder_channels: Sequence[int],
decoder_depths: Sequence[int],
decoder_plain_last: bool = True,
ratios: Sequence[float],
radiuses: Sequence[Union[float, Sequence[float]]],
num_neighbors: Sequence[Union[int, Sequence[int]]],
add_self_loops: bool = False,
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: Union[bool, List[bool]] = True,
dropout: float = 0.0,
head_channels: Optional[Sequence[int]] = None,
)
Bases: SemanticSegmentationModel
PointNeXt segmentation model as described in the paper PointNeXt: Revisiting PointNet++ with Improved Training and Scaling Strategies by Guocheng Qian, Yuchen Li, Houwen Peng, Jinjie Mai, Hasan Abed Al Kader Hammoud, Mohamed Elhoseiny, Bernard Ghanem.
PointNeXt modernizes PointNet++ through improved training strategies and architectural enhancements, achieving state-of-the-art performance while maintaining efficiency. The model introduces Inverted Residual MLP (InvResMLP) blocks, separable MLPs, and relative position normalization to enable effective model scaling.
Parameters:
-
in_channels(int) βNumber of input channels (typically 3 for XYZ coordinates, or 6 for XYZ + RGB, or more with additional features like normal).
-
num_classes(int) βNumber of output classes for segmentation.
-
stem_channels(Optional[Union[int, Sequence[int]]], default:None) βNumber of channels in the stem MLP layer(s) that map input to higher dimension. If None, no stem is used.
-
encoder_channels(Sequence[int]) βChannel dimensions for each encoder block. The number of channels should be equal to the number of blocks + 1.
-
encoder_depths(Sequence[int]) βNumber of layers in each encoder block after the initial SA block.
-
encoder_expansion(Union[int, Sequence[int]], default:4) βExpansion ratio to determine the hidden channels of the encoder blocks.
-
decoder_channels(Sequence[int]) βChannel dimensions for each decoder block. The number of channels should be equal to the number of decoder blocks + 1.
-
decoder_depths(Sequence[int]) βNumber of layers in each decoder stage.
-
ratios(Sequence[float]) βDownsampling sampling ratios for each encoder stage. The number of ratios should be equal to the number of blocks.
-
radiuses(Sequence[Union[float, Sequence[float]]]) βQuery radius for neighborhood grouping in each stage. The number of radiuses should be equal to the number of blocks + 1.
-
num_neighbors(Sequence[Union[int, Sequence[int]]]) βMaximum number of neighbors for each encoder stage. The number of num_neighbors should be equal to the number of blocks + 1.
-
add_self_loops(bool, default:False) βWhether to include the center point as its own neighbor in grouping operations.
-
spatial_dim(int, default:3) βSpatial dimensionality of point clouds (typically 3).
-
act(Union[str, Callable, None], default:'relu') βActivation function.
-
act_kwargs(Optional[Dict[str, Any]], default:None) βAdditional arguments for the activation function.
-
act_first(bool, default:False) βWhether to apply activation before normalization.
-
norm(Union[str, Callable, None], default:'batch_norm') βNormalization layer type.
-
norm_kwargs(Optional[Dict[str, Any]], default:None) βAdditional arguments for normalization layer.
-
bias(Union[bool, List[bool]], default:True) βWhether to use bias in linear / MLP layers.
-
dropout(float, default:0.0) βDropout probability before the classification head.
Methods:
-
configure_stemβBuild the stem MLP lifting the input features, or
Nonewhenstem_channelsis unset. -
configure_encoderβBuild the
PointNeXtEncoderbackbone. -
configure_decoderβBuild the
PointNeXtDecoderupsampling the coarsest features back through the encoder skips.
Attributes:
-
num_features(int) βFeature dimension \(C\) of the decoder output.
configure_stem [source] ΒΆ
Build the stem MLP lifting the input features, or None when stem_channels is unset.
configure_encoder [source] ΒΆ
configure_encoder() -> PointNeXtEncoder
Build the PointNeXtEncoder backbone.
configure_decoder [source] ΒΆ
configure_decoder() -> PointNeXtDecoder
Build the PointNeXtDecoder upsampling the coarsest features back through the encoder skips.