bev_backbone
SSD-style 2D BEV backbones shared by the voxel detectors (PointPillars, SECOND, Voxel Mamba).
Packed-format ports of the BEVBackbone / BEVResidualBackbone blocks from open-mmlab/OpenPCDet.
Classes:
-
ResidualBlock2dβResidual 2D conv block (the reference's
BasicBlock) of the BEV residual backbone. -
BEVBackboneβSSD-style multi-scale 2D BEV backbone.
-
BEVResidualBackboneβResidual SSD-style 2D BEV backbone used by Voxel Mamba.
ResidualBlock2d [source] ΒΆ
ResidualBlock2d(
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.
BEVBackbone [source] ΒΆ
BEVBackbone(
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.
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.
BEVResidualBackbone [source] ΒΆ
BEVResidualBackbone(
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 used by Voxel Mamba.
Same scaffolding as BEVBackbone (per-level block then upsample, concatenated), but each level is a stack of residual ResidualBlock2ds 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.