HDMapBEVAdapter¶
- class standard_e2e.caching.adapters.HDMapBEVAdapter(min_x=-32.0, max_x=32.0, min_y=-32.0, max_y=32.0, pixels_per_meter=4.0, channels=None, polyline_thickness=1)[source]¶
Bases:
AbstractAdapterRasterizes
StandardFrameData.hd_mapto a multi-channel BEV image.One channel per element type listed in
channels(default: every member ofMapElementTypein declaration order). Polygons are drawn filled; polylines are drawn withpolyline_thickness; points (single-rowMapElement.points) are drawn as filled circles of radiuspolyline_thickness. Output isnp.float32in[0, 1].Axis convention matches
LidarBEVAdapter: rows correspond to the vehicle x axis (forward), columns to the y axis (left). Output shape is(C, H, W)withC = len(channels),H = (max_x - min_x) * pixels_per_meter,W = (max_y - min_y) * pixels_per_meter.- Parameters:
min_x (
float) – BEV x extent in meters (vehicle x is forward).max_x (
float) – BEV x extent in meters (vehicle x is forward).min_y (
float) – BEV y extent in meters (vehicle y is left).max_y (
float) – BEV y extent in meters (vehicle y is left).pixels_per_meter (
float) – grid resolution; cast tointinternally.channels (
Optional[Sequence[Union[MapElementType,str]]]) – ordered list ofMapElementType(or their stringvaluefor YAML configs) determining channel composition and order. Defaults to all enum members in declaration order. The resolved list is exposed viametadataso downstream consumers can interpret the BEV without re-deriving the channel order.polyline_thickness (
int) – line thickness in pixels for polyline elements; also the radius of point-element circles.
- property consumes_attrs: set[StandardFrameDataField]¶
StandardFrameDatafields this adapter reads.Used by source-dataset processors to skip building modalities that no adapter consumes (lazy-load). For example, an
HDMapBEVAdapterreturns{StandardFrameDataField.HD_MAP}; a processor whose adapter chain registers no HD-map adapter can then skip the (often expensive)_build_hd_mapstep entirely.Returning an empty set means “this adapter does not gate any modality build” — appropriate for adapters that read optional
aux_datakeys (e.g. preference trajectories) which the processor populates unconditionally and cheaply.
- property metadata: dict[str, Any]¶
Expose the BEV channel order + grid so the .npz / dataset_info.yaml is self-describing (a consumer can map pixels back to meters and channels to
MapElementTypewithout re-deriving the adapter config).
- property spec: dict[str, Any]¶
name+metadata.Written to the per-(dataset, split)
dataset_info.yamlby the converter so a downstream consumer (e.g. the visualization tool) can discover what each modality contains – BEV grid params, channel orders, … – without opening an.npz. The same metadata also rides on every frame’saux_data.- Type:
Serializable description of this adapter
- transform(standard_frame_data)¶
Validate input frame and dispatch to subclass implementation.
- Return type:
- Parameters:
standard_frame_data (StandardFrameData)