conda create -n MomAD_env python=3.8 -y
conda activate MomAD_envMomAD_path="path/to/MomAD"
cd ${MomAD_path}
pip3 install --upgrade pip
pip3 install torch==1.13.0+cu116 torchvision==0.14.0+cu116 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu116
pip3 install -r requirement.txt🔥 Tips
-
It is necessary to install the
mmcv-fullversion ofmmcv. It is recommended to usecuda113andtorch1.11.0, and to installmmcvversion1.7.2. Use the following command:pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.11.0/index.html -i https://pypi.tuna.tsinghua.edu.cn/simple -
Remember to install
flash-attnoffline. The download address forflash_attn-0.2.2+cu113torch1.11.0-cp38-cp38-linux_x86_64.whlis here. Move the file to theMomADfolder and execute the following command to install:pip install flash_attn-0.2.2+cu113torch1.11.0-cp38-cp38-linux_x86_64.whl
cd projects/mmdet3d_plugin/ops
python3 setup.py develop
cd ../../../Download the NuScenes dataset and CAN bus expansion, put CAN bus expansion in /path/to/nuscenes, create symbolic links.
cd ${MomAD_path}
mkdir data
ln -s path/to/nuscenes ./data/nuscenesPack the meta-information and labels of the dataset, and generate the required pkl files to data/infos. Note that we also generate map_annos in data_converter, with a roi_size of (30, 60) as default, if you want a different range, you can modify roi_size in tools/data_converter/nuscenes_converter.py.
sh scripts/create_data.shGnerated anchors are saved to data/kmeans and can be visualized in vis/kmeans.
sh scripts/kmeans.shDownload the required backbone pre-trained weights.
mkdir ckpt
wget https://download.pytorch.org/models/resnet50-19c8e357.pth -O ckpt/resnet50-19c8e357.pthbash ./tools/dist_train.sh \
projects/configs/MomAD_small_stage2_roboAD.py \
8 \
bash ./tools/dist_train.sh \
projects/configs/MomAD_small_stage2_roboAD_6s.py \
8 \
bash ./tools/dist_test.sh \
projects/configs/MomAD_small_stage2_roboAD.py \
work_dirs/MomAD_small_stage2_roboAD/MomAD_3s.pth\
1 \
--deterministic \
--eval bbox
bash ./tools/dist_test.sh \
projects/configs/MomAD_small_stage2_roboAD_6s.py \
work_dirs/MomAD_small_stage2_roboAD/MomAD_6s.pth\
1 \
--deterministic \
--eval bbox
sh scripts/visualize.sh