Skip to content

vfe

Dynamic voxel feature encoder shared by the voxel detectors (Voxel Mamba, LION).

A packed-format port of the DynamicVoxelVFE from gwenzhang/Voxel-Mamba.

Classes:

  • PFNLayer –

    Pillar feature net layer (the reference's PFNLayerV2): linear + norm + ReLU with a per-voxel max-pool.

  • DynamicMeanVFE –

    Dynamic mean voxel feature encoder for the Voxel Mamba detector.

PFNLayer

PFNLayer(in_channels: int, out_channels: int, last: bool)

Bases: Module

Pillar feature net layer (the reference's PFNLayerV2): linear + norm + ReLU with a per-voxel max-pool.

Non-final layers halve their output width and concatenate the pooled feature back onto every point; the final layer returns the pooled per-voxel feature directly.

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 PFN layer.

Shape
  • Input: \((N, C_\text{in})\) point features and \((N,)\) voxel index.
  • Output: \((N, C')\) for non-final layers, \((M, C_\text{out})\) for the final layer.

DynamicMeanVFE

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.