A temporal stability evaluation benchmark and toolkit for online HD mapping
Hao Shan, Ruikai Li, Han Jiang, Yizhe Fan, Ziyang Yan, Bohan Li, Xiaoshuai Hao, Hao Zhao, Zhiyong Cui, Yilong Ren, Haiyang Yu
This repository provides the official stability evaluation toolkit (MapTR Stability Eval) used to reproduce mAS and other stability metrics in the paper.
As a fundamental module in autonomous driving, online HD mapping has attracted increasing attention due to its cost-effectiveness and real-time capability. However, when a vehicle moves through highly dynamic environments, sensor displacement can cause drift in real-time map predictions. This temporal instability poses a fundamental challenge for downstream tasks. Existing online mapping methods mainly focus on single-frame accuracy, while temporal stability has not been systematically studied.
This work presents the first temporal stability benchmark for online vectorized HD mapping, including:
- A multi-dimensional stability framework: Presence consistency, Localization stability, and Shape stability
- A unified metric mAS (mean Average Stability)
- Large-scale experiments on 42 models and variants, showing that accuracy (mAP) and stability (mAS) are relatively independent performance dimensions
- An open benchmark and toolkit for easy reproduction and extension by the community
This toolkit supports both PKL and NPZ prediction formats. You can evaluate stability directly from saved predictions without rerunning model inference. It is already compatible with outputs from MapTR, PivotNet, BEVMapNet, StreamMapNet, and more.
- Features
- Installation
- Quick Start
- Stability Metrics
- Configurations and Data Formats
- Visualization
- Citation
- Acknowledgement and Contact
| Feature | Description |
|---|---|
| Multi-format support | Supports PKL (single file) and NPZ (token-based folder) prediction results |
| Multi-model compatibility | MapTR, PivotNet, BEVMapNet, StreamMapNet, and more |
| Direct evaluation | Evaluate directly from prediction files without rerunning forward inference |
| Flexible configuration | Define field mappings and evaluation parameters via config files |
| Stability metrics | Presence consistency, localization stability, shape stability, and mAS |
| Geometry and alignment | Polyline processing, coordinate transforms, IoU computation, and GT alignment |
| Visualization | Scripts for stability result and trajectory visualization |
| NuScenes integration | Supports ego pose and dataset parsing |
maptr_stability_eval/
βββ src/maptr_stability_eval/ # Core code
β βββ geometry/ # Geometry (polyline and coordinate transform)
β βββ stability/ # Stability metrics, alignment, and assigner
β βββ data_parser/ # PKL/NPZ/NuScenes parsing
β βββ utils/ # Config and utility functions
βββ configs/ # Model configs (maptr/pivotnet/bemapnet/streammapnet)
βββ src/vis/ # Visualization scripts
βββ tools/ # Evaluation and visualization shell scripts
βββ main.py # Evaluation entry point
βββ requirements.txt
βββ README.md
- Python >= 3.7
- No GPU or deep learning framework required (evaluation and visualization only)
- Supports Linux / macOS / Windows
git clone <repository-url>
cd maptr_stability_eval
pip install -r requirements.txt
pip install -e .Optional: install NuScenes support if needed:
pip install nuscenes-devkitCore dependencies: numpy, scipy, shapely, tqdm, tabulate, matplotlib, seaborn, pandas (see requirements.txt).
python main.py \
--data-format pkl \
--prediction-file results.pkl \
--config configs/maptr_trainval.py \
--output-dir outputspython main.py \
--data-format npz \
--prediction-file npz_folder/ \
--config configs/pivotnet_trainval.py \
--output-dir outputs| Argument | Description | Default |
|---|---|---|
--data-format |
pkl or npz |
pkl |
--prediction-file |
Prediction file or NPZ directory | Required |
--config |
Config file path | Required |
--output-dir |
Output directory | outputs |
--data-root |
NuScenes data root | Optional |
--stability-classes |
Classes to evaluate | divider ped_crossing boundary |
--stability-interval |
Frame interval | 2 |
--localization-weight |
Localization stability weight | 0.5 |
--detection-threshold |
Detection threshold | 0.3 |
For more options (e.g., pred-rotate-deg, pred-swap-xy, pred-flip-x/y), run main.py --help.
| Metric | Meaning |
|---|---|
| Presence | Detection consistency of the same instance across consecutive frames |
| Localization | Location stability based on polyline IoU |
| Shape | Shape stability based on curvature variation |
| mAS | Composite stability: Presence Γ (Localization Γ W + Shape Γ (1βW)), where W is localization_weight |
Example output:
----------------------------------
MapTR Stability Index Results
----------------------------------
| class | SI | presence | localization | shape |
|--------------|-------|----------|--------------|-------|
| divider | 0.8234| 0.9123 | 0.8456 | 0.7891|
| ped_crossing | 0.7891| 0.8765 | 0.8123 | 0.7456|
| boundary | 0.8567| 0.9234 | 0.8678 | 0.8234|
| mean | 0.8231| 0.9041 | 0.8419 | 0.7860|
----------------------------------
- Configurations:
configs/provides*_trainval.py/*_mini.pyfiles by model and dataset (e.g.,maptr_trainval.py,pivotnet_trainval.py), including field mapping, class mapping, and stability parameters. - PKL: A single file where each list item is a sample dictionary, typically containing polylines, classes, scores, sample indices, and related fields (see each config's
field_mapping). - NPZ: One
.npzfile per token in a folder; expected fields includepts_3d,labels_3d,scores_3d, etc. (see config files).
For detailed field descriptions and examples, refer to comments in each configuration file. PKL/NPZ structures should match the corresponding field_mapping.
# Visualize stability of prediction results
python src/vis/vis_stability.py \
--prediction-file results.pkl \
--config configs/maptr_trainval.py \
--output-dir vis_outputs \
--data-format pklFor GT and prediction visualization, see tools/vis_groundtruth.sh, tools/vis_prediction.sh, and scripts under src/vis/.
If this benchmark or toolkit helps your research, please cite:
@inproceedings{stablehdmap2026,
title = {Stability Under Scrutiny: Benchmarking Representation Paradigms for Online HD Mapping},
author = {Shan, Hao and Li, Ruikai and Jiang, Han and Fan, Yizhe and Yan, Ziyang and Li, Bohan and Hao, Xiaoshuai and Zhao, Hao and Cui, Zhiyong and Ren, Yilong and Yu, Haiyang},
booktitle = {International Conference on Learning Representations (ICLR)},
year = {2026},
url = {https://openreview.net/forum?id=mxz5RqhCMe}
}- Paper: OpenReview
- Project Page: https://stablehdmap.github.io/
- Thanks to OpenMMLab, MapTR, PivotNet, and related works for inspiration and contributions.
- Author: Hao Shan
- Email: [email protected]
Issues and pull requests are welcome.
MIT License
π More Docs (installation details, development guide, testing, changelog)
# Unit tests
pytest tests/
# NPZ loading and examples
python test_npz_loader.py
python example_usage.py
python demo_npz_usage.py- New metrics: implement in
stability/metrics.pyand register in the main evaluation pipeline. - New data format: add a config in
configs/, and add or reuse a loader indata_parser/. - New visualization: add scripts in
src/vis/ortools/, keeping compatibility with current output format.
- v1.0.0: Initial release; PKL/NPZ support; complete stability evaluation and visualization.
- Recent: Additional model configs (BEVMapNet, StreamMapNet, etc.); enhanced NPZ and visualization support.