|
6 månader sedan | |
---|---|---|
.. | ||
configs | 6 månader sedan | |
dependencies | 6 månader sedan | |
libraries | 6 månader sedan | |
qat | 6 månader sedan | |
src | 6 månader sedan | |
tool | 6 månader sedan | |
.gitignore | 6 månader sedan | |
CMakeLists.txt | 6 månader sedan | |
CUDA-BEVFusion.pro | 6 månader sedan | |
README.md | 6 månader sedan | |
bevparams.xml | 6 månader sedan |
This repository contains sources and model for BEVFusion inference using CUDA & TensorRT.
Model | Framework | Precision | mAP | NDS | FPS |
---|---|---|---|---|---|
Swin-Tiny BEVFusion-Base |
PyTorch | FP32+FP16 | 68.52 | 71.38 | 8.4(on RTX3090) |
ResNet50 | PyTorch | FP32+FP16 | 67.93 | 70.97 | - |
ResNet50 | TensorRT | FP16 | 67.89 | 70.98 | 18(on ORIN) |
ResNet50-PTQ | TensorRT | FP16+INT8 | 67.66 | 70.81 | 25(on ORIN) |
To build bevfusion, we need to depend on the following libraries:
The data in the performance table was obtained by us on the Nvidia Orin platform, using TensorRT-8.6, cuda-11.4 and cudnn8.6 statistics.
git clone --recursive
to pull this repository to ensure the integrity of the dependencies.download nuScenes-example-data.zip from ( NVBox ) or ( Baidu Drive )
# download models and datas to CUDA-BEVFusion
cd CUDA-BEVFusion
# unzip models and datas
unzip model.zip
unzip nuScenes-example-data.zip
# here is the directory structure after unzipping
CUDA-BEVFusion
|-- example-data
|-- 0-FRONT.jpg
|-- 1-FRONT_RIGHT.jpg
|-- ...
|-- camera_intrinsics.tensor
|-- ...
|-- example-data.pth
`-- points.tensor
|-- src
|-- qat
|-- model
|-- resnet50int8
| |-- bevfusion_ptq.pth
| |-- camera.backbone.onnx
| |-- camera.vtransform.onnx
| |-- default.yaml
| |-- fuser.onnx
| |-- head.bbox.onnx
| `-- lidar.backbone.xyz.onnx
|-- resnet50
`-- swint
|-- bevfusion
`-- tool
Install python dependency libraries
apt install libprotobuf-dev
pip install onnx
Modify the TensorRT/CUDA/CUDNN/BEVFusion variable values in the tool/environment.sh file.
# change the path to the directory you are currently using
export TensorRT_Lib=/path/to/TensorRT/lib
export TensorRT_Inc=/path/to/TensorRT/include
export TensorRT_Bin=/path/to/TensorRT/bin
export CUDA_Lib=/path/to/cuda/lib64
export CUDA_Inc=/path/to/cuda/include
export CUDA_Bin=/path/to/cuda/bin
export CUDA_HOME=/path/to/cuda
export CUDNN_Lib=/path/to/cudnn/lib
# For CUDA-11.x: SPCONV_CUDA_VERSION=11.4
# For CUDA-12.x: SPCONV_CUDA_VERSION=12.6
export SPCONV_CUDA_VERSION=11.4
# resnet50/resnet50int8/swint
export DEBUG_MODEL=resnet50int8
# fp16/int8
export DEBUG_PRECISION=int8
export DEBUG_DATA=example-data
export USE_Python=OFF
Apply the environment to the current terminal.
. tool/environment.sh
Building the models for tensorRT
bash tool/build_trt_engine.sh
Compile and run the program
# Generate the protobuf code
bash src/onnx/make_pb.sh
# Compile and run
bash tool/run.sh
USE_Python=ON
in environment.sh to enable compilation of python.bash tool/run.sh
to build the libpybev.so.python tool/pybev.py
to test the python interface.Use the following command to get a specific commit to avoid failure.
git clone https://github.com/mit-han-lab/bevfusion
cd bevfusion
git checkout db75150717a9462cb60241e36ba28d65f6908607