Skip to content

Repository files navigation

πŸ—ΊοΈ StableHDMap

Stability Under Scrutiny: Benchmarking Representation Paradigms for Online HD Mapping

A temporal stability evaluation benchmark and toolkit for online HD mapping

ICLR 2026 Project Page Paper License

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.


πŸ“Œ Introduction

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.


πŸ“‹ Table of Contents


✨ Features

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

πŸ“ Project Structure

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

πŸ”§ Installation

Requirements

  • Python >= 3.7
  • No GPU or deep learning framework required (evaluation and visualization only)
  • Supports Linux / macOS / Windows

Install Steps

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-devkit

Core dependencies: numpy, scipy, shapely, tqdm, tabulate, matplotlib, seaborn, pandas (see requirements.txt).


πŸš€ Quick Start

PKL format (e.g., MapTR)

python main.py \
    --data-format pkl \
    --prediction-file results.pkl \
    --config configs/maptr_trainval.py \
    --output-dir outputs

NPZ format (e.g., PivotNet)

python main.py \
    --data-format npz \
    --prediction-file npz_folder/ \
    --config configs/pivotnet_trainval.py \
    --output-dir outputs

Common Arguments

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.


πŸ“Š Stability Metrics

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 and Data Formats

  • Configurations: configs/ provides *_trainval.py / *_mini.py files 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 .npz file per token in a folder; expected fields include pts_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.


πŸ–ΌοΈ Visualization

# 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 pkl

For GT and prediction visualization, see tools/vis_groundtruth.sh, tools/vis_prediction.sh, and scripts under src/vis/.


πŸ“– Citation

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}
}

πŸ™ Acknowledgement and Contact

  • Thanks to OpenMMLab, MapTR, PivotNet, and related works for inspiration and contributions.
  • Author: Hao Shan
  • Email: [email protected]

Issues and pull requests are welcome.


πŸ“œ License

MIT License


πŸ“š More Docs (installation details, development guide, testing, changelog)

Development and Testing

# Unit tests
pytest tests/

# NPZ loading and examples
python test_npz_loader.py
python example_usage.py
python demo_npz_usage.py

Extension Guide

  • New metrics: implement in stability/metrics.py and register in the main evaluation pipeline.
  • New data format: add a config in configs/, and add or reuse a loader in data_parser/.
  • New visualization: add scripts in src/vis/ or tools/, keeping compatibility with current output format.

Changelog

  • 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.

About

No description, website, or topics provided.

Resources

Stars

49 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages