py123d_detection.torch.models.bevformer.encoder¶
Stacks encoder layers that apply: 1. Deformable self-attention among BEV queries 2. Spatial cross-attention from BEV queries to multi-view image features 3. Feed-forward network
Classes
|
A stack of |
|
One layer of the BEV encoder. |
- class py123d_detection.torch.models.bevformer.encoder.BEVFormerEncoderLayer(embed_dims=256, num_heads=8, feedforward_channels=512, dropout=0.1, num_points_self=4, num_points_cross=8, num_heights=4, with_cp=True)[source]¶
Bases:
ModuleOne layer of the BEV encoder.
Pre-norm, three blocks, each with a residual: deformable self-attention over the BEV grid, so a cell can read its neighbours; spatial cross-attention into the camera features, so it can read the images; then a feed-forward network.
- Parameters:
embed_dims (
int) – Feature dimension.num_heads (
int) – Attention heads.feedforward_channels (
int) – Hidden width of the feed-forward network.dropout (
float) – Dropout rate.num_points_self (
int) – Sampling points for the self-attention.num_points_cross (
int) – Sampling points for the cross-attention.num_heights (
int) – Pillar height count, which has to match thenum_Z_anchorsdimension of the 3D reference points.with_cp (
bool) – Gradient-checkpoint the layer.
- class py123d_detection.torch.models.bevformer.encoder.BEVFormerEncoder(num_layers=3, embed_dims=256, num_heads=8, feedforward_channels=512, dropout=0.1, num_points_self=4, num_points_cross=8, num_heights=4, with_cp=True)[source]¶
Bases:
ModuleA stack of
BEVFormerEncoderLayer.- Parameters:
num_layers (
int) – How many layers; 3 is BEVFormer-S.embed_dims (
int) – Feature dimension.num_heads (
int) – Attention heads.feedforward_channels (
int) – Hidden width of each layer’s feed-forward network.dropout (
float) – Dropout rate.num_points_self (
int) – Sampling points for the self-attention.num_points_cross (
int) – Sampling points for the cross-attention.num_heights (
int) – Pillar height count for the spatial cross-attention.with_cp (
bool) – Gradient-checkpoint each layer.