A-suozhang / ada3d

Code of ICCV23 paper: Ada3D : Exploiting the Spatial Redundancy with Adaptive Inference for Efficient 3D Object Detection
27 stars 1 forks source link

Ada3D : Exploiting the Spatial Redundancy with Adaptive Inference for Efficient 3D Object Detection, ICCV23

Authors: Tianchen Zhao, Xuefei Ning, Ke Hong, Zhongyuan Qiu, Pu Lu, Yali Zhao, Linfeng Zhang, Lipu Zhou, Guohao Dai, Huazhong Yang, Yu Wang

This is the implemention of the ICCV23 paper: Ada3D, For more information, please refer to our Project Page at https://a-suozhang.xyz/ada3d.github.io/

Get Started

The code is tested on the environment listed below:

torch=1.9.1+cu111
spconv=1.2
openpcdet=0.6.0+633bd6b
CUDA=11.1
RTX3090 GPU. 

(1) Setup the Environment :

pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
cd SparseBEVTools
python setup.py develop
pip install -r requirements.txt
python setup.py develop

(2) Prepare the Data:

ln -s $KITTI_PATH ./data/kitti

(3) Download the Pre-trained Model:

(More pre-trained models on the way)

Usage

Training

  1. enter the ./tools folder

  2. train the model with Sparsity-Preserving BN:

python train.py --cfg_file ./cfgs/masked_bn.yaml --extra_tag masked_bn

(the distributed data parallel training is supported, with the same input args of the command example:)

CUDA_VISIBLE_DEVICES=0,1 bash scripts/dist_train.sh 2 --cfg_file ./cfgs/masked_bn.yaml --extra_tag masked_bn
  1. train the predictor (with the generated model from the 1st step)
python train.py --cfg_file ./cfgs/predictor_masked_bn.yaml --extra_tag predictor_train --ckpt ../output/cfgs/masked_bn/default/ckpt/latest_model.pth
  1. joint fintune the predictor and the backbone (with the generated model from the 2nd step):
python train.py --cfg_file ./cfgs/predictor_masked_bn_tune.yaml --extra_tag predictor_tune --ckpt ../output/cfgs/predictor/default/ckpt/latest_model.pth --hard_drop

Testing

python test.py --cfg ./cfgs/predictor_masked_bn_tune.yaml --ckpt ./pretrained-models/checkpoint.pth --hard_drop

Acknowledgement

This project relies on code and libraries from other open-source projects. We want to express our gratitude to the following developers and projects:

Citation

If you find our work is useful in your research, please consider citing:

@article{Zhao2023Ada3DE,
  title={Ada3D : Exploiting the Spatial Redundancy with Adaptive Inference for Efficient 3D Object Detection},
  author={Tianchen Zhao and Xuefei Ning and Ke Hong and Zhongyuan Qiu and Pu Lu and Yali Zhao and Linfeng Zhang and Lipu Zhou and Guohao Dai and Huazhong Yang and Yu Wang},
  journal={ArXiv},
  year={2023},
  volume={abs/2307.08209},
  url={https://api.semanticscholar.org/CorpusID:259937318}
}

TODO