Skip to content

bev_backbone

SSD-style 2D BEV backbones shared by the voxel detectors (PointPillars, SECOND, Voxel Mamba).

Packed-format ports of the BaseBEVBackbone / BaseBEVResBackbone blocks from open-mmlab/OpenPCDet.

Classes:

  • BasicBlock2d –

    Residual 2D conv block (the reference's BasicBlock) of the BEV residual backbone.

  • BaseBEVBackbone –

    SSD-style multi-scale 2D BEV backbone (BaseBEVBackbone).

  • BaseBEVResBackbone –

    Residual SSD-style 2D BEV backbone (BaseBEVResBackbone) used by Voxel Mamba.

BasicBlock2d

BasicBlock2d(
    in_channels: int,
    out_channels: int,
    *,
    stride: int = 1,
    downsample: bool = False,
    norm: Union[str, Callable, None] = "batch_norm",
    norm_kwargs: Optional[Dict[str, Any]] = None,
    act: Union[str, Callable, None] = "relu",
    act_kwargs: Optional[Dict[str, Any]] = None,
)

Bases: Module

Residual 2D conv block (the reference's BasicBlock) of the BEV residual backbone.

Parameters:

  • in_channels (int) –

    Input channels.

  • out_channels (int) –

    Output channels.

  • stride (int, default: 1 ) –

    Stride of the first conv (and the optional projection shortcut).

  • downsample (bool, default: False ) –

    Add a \(1\times1\) projection shortcut to match channels / stride.

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

    Normalization type or callable.

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

    Extra normalization arguments.

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

    Activation type or callable.

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

    Extra activation arguments.

BaseBEVBackbone

BaseBEVBackbone(
    input_channels: int,
    layer_nums: Sequence[int],
    layer_strides: Sequence[int],
    num_filters: Sequence[int],
    upsample_strides: Sequence[float],
    num_upsample_filters: Sequence[int],
    *,
    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

SSD-style multi-scale 2D BEV backbone (BaseBEVBackbone).

Each level downsamples the BEV pseudo-image with a strided \(3\times3\) conv followed by layer_nums residual-free \(3\times3\) convs, then upsamples back to a common stride; the level outputs are concatenated along the channel dim. An upsample factor \(\geq 1\) uses a transposed conv, a factor \(< 1\) (e.g. \(0.5\)) a strided down-conv (nuScenes configs use both).

Parameters:

  • input_channels (int) –

    Channels of the input BEV feature map.

  • layer_nums (Sequence[int]) –

    Number of \(3\times3\) convs after the strided conv, per level.

  • layer_strides (Sequence[int]) –

    Downsample stride of the leading conv, per level.

  • num_filters (Sequence[int]) –

    Channel width, per level.

  • upsample_strides (Sequence[float]) –

    Upsample factor per level.

  • num_upsample_filters (Sequence[int]) –

    Channels of each upsampled level.

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

    Activation type or callable for every conv block.

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

    Extra activation arguments.

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

    Normalization type or callable for every conv block.

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

    Extra normalization arguments.

BaseBEVResBackbone

BaseBEVResBackbone(
    input_channels: int,
    layer_nums: Sequence[int],
    layer_strides: Sequence[int],
    num_filters: Sequence[int],
    upsample_strides: Sequence[float],
    num_upsample_filters: Sequence[int],
    *,
    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

Residual SSD-style 2D BEV backbone (BaseBEVResBackbone) used by Voxel Mamba.

Same scaffolding as BaseBEVBackbone (per-level block then upsample, concatenated), but each level is a stack of residual BasicBlock2ds instead of plain \(3\times3\) convs.

Parameters:

  • input_channels (int) –

    Channels of the input BEV feature map.

  • layer_nums (Sequence[int]) –

    Number of residual blocks after the strided block, per level.

  • layer_strides (Sequence[int]) –

    Downsample stride of the leading block, per level.

  • num_filters (Sequence[int]) –

    Channel width, per level.

  • upsample_strides (Sequence[float]) –

    Upsample factor per level.

  • num_upsample_filters (Sequence[int]) –

    Channels of each upsampled level.

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

    Activation type or callable for every conv block.

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

    Extra activation arguments.

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

    Normalization type or callable for every conv block.

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

    Extra normalization arguments.