Home

Awesome

PolarFormer

<!-- TODO update the url to v2 -->

Paper

PolarFormer: Multi-camera 3D Object Detection with Polar Transformers,
Yanqin Jiang, Li Zhang, Zhenwei Miao, Xiatian Zhu, Jin Gao, Weiming Hu, Yu-Gang Jiang
AAAI 2023

This repository is an official implementation of PolarFormer.

<div align="center"> <img src="figs/pipeline.png"/> </div><br/>

Abstract

3D object detection in autonomous driving aims to reason “what” and “where” the objects of interest present in a 3D world. Following the conventional wisdom of previous 2D object detection, existing 3D object detection methods often adopt the canonical Cartesian coordinate system with perpendicular axis. However, we conjugate that this does not fit the nature of the ego car’s perspective, as each onboard camera perceives the world in shape of wedge intrinsic to the imaging geometry with radical (non-perpendicular) axis. Hence, in this paper we advocate the exploitation of the Polar coordinate system and propose a new Polar Transformer (PolarFormer) for more accurate 3D object detection in the bird’s-eye-view (BEV) taking as input only multi-camera 2D images. Specifically, we design a cross-attention based Polar detection head without restriction to the shape of input structure to deal with irregular Polar grids. For tackling the unconstrained object scale variations along Polar’s distance dimension, we further introduce a multiscale Polar representation learning strategy As a result, our model can make best use of the Polar representation rasterized via attending to the corresponding image observation in a sequence-to-sequence fashion subject to the geometric constraints. Thorough experiments on the nuScenes dataset demonstrate that our PolarFormer outperforms significantly state-of-the-art 3D object detection alternatives, as well as yielding competitive performance on BEV semantic segmentation task.

News

Get Started

Environment

This implementation is build upon detr3d, please follow the steps in install.md to prepare the environment.

Data

Please follow the official instructions of mmdetection3d to process the nuScenes dataset.(https://mmdetection3d.readthedocs.io/en/v0.17.3/datasets/nuscenes_det.html)

After preparation, you will be able to see the following directory structure:

PolarFormer
├── mmdetection3d
├── projects
│   ├── configs
│   ├── mmdet3d_plugin
├── tools
├── data
│   ├── nuscenes
├── ckpts
├── README.md

Train & inference

cd PolarFormer

You can train the model following:

tools/dist_train.sh projects/configs/polarformer/polarformer_r101.py.py 8 --work-dir work_dirs/polarformer_r101/

You can evaluate the model following:

tools/dist_test.sh projects/configs/polarformer/polarformer_r101.py work_dirs/polarformer_r101/latest.pth 8 --eval bbox

Main Results

3D Object Detection on nuScenes test set:

modelmAPNDS
PolarFormer, R101_DCN41.547.0
PolarFormer-T, R101_DCN45.754.3
PolarFormer, V2-9945.550.3
PolarFormer-T, V2-9949.357.2
<br>

3D Object Detection on nuScenes validation set:

modelmAPNDSconfigdownload
PolarFormer, R101_DCN39.645.8configckpt
PolarFormer-w/o_bev_aug, R101_DCN39.246.0configckpt / log
PolarFormer-T, R101_DCN43.252.8--
PolarFormer, V2-9950.056.2configckpt
<br>

Note: We adopt BEV data augmentation(random flipping, scaling and rotation) as the default setting when developing PolarFormer on nuScenes dataset. However, as the ablation in 2nd row indicates, BEV augmentation contributes little to the overall performance of PolarFormer. So please feel free to set "use_bev_aug = False" during training if you want to reduce computational burden.

BEV Segmentation on nuScenes validation set:

modelDrivableCrossingWalkingCarparkDivider
PolarFormer, efficientnet-b081.048.955.852.642.2
PolarFormer-T, efficientnet-b082.654.359.456.746.2
PolarFormer-joint_det_seg, R101_DCN82.650.157.454.144.5
<br>

Visualization

<div align="center"> <img src="figs/visualization.png"/> </div><br/>

Reference

@inproceedings{jiang2022polar,
  title={PolarFormer: Multi-camera 3D Object Detection with Polar Transformers},
  author={Jiang, Yanqin and Zhang, Li and Miao, Zhenwei and Zhu, Xiatian and Gao, Jin and Hu, Weiming and Jiang, Yu-Gang},
  booktitle={AAAI},
  year={2023}
}

Acknowledgement

Many thanks to the following open-source projects: