vfe
Voxel feature encoders: the pillar feature-net layer and the dynamic mean voxel encoder.
The dynamic encoder is a packed-format port of the DynamicVoxelVFE from gwenzhang/Voxel-Mamba.
Classes:
-
PillarFeatureLayerβPillar feature-net layer: linear + norm + act on every point, then a max-pool over each pillar.
-
DynamicMeanVFEβDynamic mean voxel feature encoder for the Voxel Mamba detector.
PillarFeatureLayer [source] ΒΆ
PillarFeatureLayer(
in_channels: int,
out_channels: int,
last: bool,
*,
act: Union[str, Callable, None] = "relu",
act_kwargs: Optional[Dict[str, Any]] = None,
norm: Union[str, Callable, None] = "batch_norm",
norm_kwargs: Optional[Dict[str, Any]] = None,
)
Bases: Module
Pillar feature-net layer: linear + norm + act on every point, then a max-pool over each pillar.
Non-final layers halve their output width and concatenate the pooled feature back onto every point of the pillar; the final layer returns the pooled per-pillar feature. Padded pillars come as a dense \((P, N, C)\) tensor pooled over the point axis; dynamically voxelized points come packed as \((N, C)\) with their pillar_index, and are pooled by index.
Parameters:
-
in_channels(int) βInput feature channels.
-
out_channels(int) βTarget output channels (halved internally for non-final layers).
-
last(bool) βWhether this is the final layer.
-
act(Union[str, Callable, None], default:'relu') βActivation type or callable.
-
act_kwargs(Optional[Dict[str, Any]], default:None) βExtra activation arguments.
-
norm(Union[str, Callable, None], default:'batch_norm') βNormalization type or callable.
-
norm_kwargs(Optional[Dict[str, Any]], default:None) βExtra normalization arguments.
Shape
- Input: \((P, N, C_\text{in})\) padded pillars, or \((N, C_\text{in})\) packed points with an \((N,)\) pillar index.
- Output: the input layout with \(C_\text{out}\) channels for non-final layers; \((P, 1, C_\text{out})\) or \((P, C_\text{out})\) pooled features for the final layer.
DynamicMeanVFE [source] ΒΆ
DynamicMeanVFE(
in_channels: int,
num_filters: Sequence[int],
voxel_size: Sequence[float],
point_cloud_range: Sequence[float],
grid_size: Sequence[int],
)
Bases: Module
Dynamic mean voxel feature encoder for the Voxel Mamba detector.
Points are assigned to voxels on the fly (no fixed points-per-voxel), augmented with the per-voxel cluster-mean offset and voxel-center offset, then encoded by a stack of linear + norm + ReLU PFN layers whose per-voxel max-pool produces one feature vector per voxel.
Reference implementation: gwenzhang/Voxel-Mamba (DynamicVoxelVFE).
Parameters:
-
in_channels(int) βRaw point feature channels including xyz (e.g. \(5\) for Waymo \(x, y, z, \text{intensity}, \text{elongation}\)).
-
num_filters(Sequence[int]) βOutput width of each PFN layer; the last entry is the voxel feature dim.
-
voxel_size(Sequence[float]) βVoxel size \((v_x, v_y, v_z)\).
-
point_cloud_range(Sequence[float]) βRange \((x_\min, y_\min, z_\min, x_\max, y_\max, z_\max)\).
-
grid_size(Sequence[int]) βVoxel grid extent \((n_x, n_y, n_z)\).
Shape
- Input: \((N, C_\text{in})\) point features and \((N,)\) batch index.
- Output: \((M, C_\text{out})\) voxel features and \((M, 4)\) voxel coords.