Table of contents

November 9, 2023 · View on GitHub

BEV Toolbox

Get Started

Installation

pip install numpy opencv-python
pip install bev-toolbox

A simple example

We provide an example with a sample from Waymo dataset to introduce the usage of this toolbox.

import cv2
import numpy as np
from bev_toolbox.data_aug import RandomScaleImageMultiViewImage

# Declare an augmentation pipeline
transform = RandomScaleImageMultiViewImage(scales=[0.9, 1.0, 1.1])

# multiple-view images
imgs = [cv2.imread(f'example/cam{i}_img.jpg') for i in range(5)]
# intrinsic parameters of cameras
cam_intr = [np.load(f'example/cam{i}_intrinsic.npy') for i in range(5)]
# extrinsic parameters of cameras
cam_extr = [np.load(f'example/cam{i}_extrinsic.npy') for i in range(5)]
# transformations from lidar to image
lidar2img = [np.load(f'example/cam{i}_lidar2img.npy') for i in range(5)]

# Augment an image
imgs_new, cam_intr_new, lidar2img_new = transform(imgs, cam_intr, cam_extr, lidar2img)

For more details like the coordinate systems or visualization, please refer to example.md

Use BEV toolbox with mmdet3d

We provide wrappers of this BEV toolbox for mmdet3d and detectron2.

  1. Add the following code to train_video.py or test_video.py.
from bev_toolbox.init_toolbox import init_toolbox_mmdet3d
init_toolbox_mmdet3d()
  1. Use functions in the toolbox just like mmdet3d. For example, you can just add RandomScaleImageMultiViewImage to the configure file.
train_pipeline = [
    ...
    dict(type='RandomScaleImageMultiViewImage', scales=[0.9, 1.0, 1.1]),
    ...
]

Use BEV-toolbox with detectron2

We plan to make this toolbox compatible with detectron2 in the future.

Playground on Waymo

We provide a suitable playground on the Waymo dataset, including hands-on tutorial and small-scale dataset (1/5 WOD in kitti format) to validate idea.

Setup

Please refer to waymo_setup.md about how to run experiments on Waymo.

Config with Performance

We provide the improvement of each trick compared with the baseline on the Waymo validation set. All the models are trained with 1/5 training data of Waymo v1.3 which is represented as Waymo mini here. It's worthy noting that the results were run on data with png format. We are revalidating these results on the data with jpg format. So, the actual performance may be different.

✓: DONE, ☐: TODO.

BackboneHeadTrain dataTrick and corresponding configLET-mAPLLET-mAPHL1/mAPH (Car)Status
ResNet101DETRWaymo miniBaseline34.946.325.5
ResNet101DETRWaymo miniMulti-scale resize, Flip35.646.926.8
ResNet101DETRWaymo miniConv offset in TSA35.948.125.6
ResNet101DETRWaymo miniDeformable view encoder36.148.125.9
ResNet101DETRWaymo miniCorner pooling35.646.926.0
ResNet101DETRWaymo mini2x BEV scale]--25.5
ResNet101DETRWaymo miniSync BN--25.5
ResNet101DETRWaymo miniEMA--25.6
ResNet101DETRWaymo mini2d auxiliary loss35.347.424.6
ResNet101DETRWaymo mini2d auxiliary loss, Learnable loss weight36.248.125.4
ResNet101DETRWaymo miniSmooth L1 loss--26.2
ResNet101DETRWaymo miniLabel smoothing36.046.7-

Ongoing Features

Literature Survey

  • Add new papers.

BEV toolbox

  • Data augmentation methods for BEV perception
    • Random horizontal flip
    • Random scale
    • Grid mask
    • New data augmentation
  • Integrate more tricks
    • Post-process
      • Test-time Augmentation
      • Weighted Box Fusion
      • Two-stage Ensemble
    • BEV Encoder
    • Loss Family
  • Add Visualization in BEV
  • Improve the current implementations.
  • Add documentation to introduce the APIs of the toolbox