Implementation of paper "Addressing Class Imbalance in VIC3D Object Detection: A Model Ensemble and Multi-modal Fusion Innovation"
-
Config environment of OpenPCDet
-
Running the following instruction in directory
OpenPCDet_DAIR:python -m pcdet.datasets.v2x.kitti_dataset create_kitti_infos tools/cfgs/dataset_configs/v2x_v_dataset.yaml
to generate info files of dataset.
-
Training vehicle-side detection model CenterPoint
cd OpenPCDet_DAIR bash scripts/dist_train.sh 4 cfgs/v2x_models/centerpoint_car.yamlPlease set arg
TEST_AUGMENTORas True in filecenterpoint_car.yaml. Then:python tta_test.py –cfg_file cfgs/v2x_models/centerpoint_car.yaml
-
Training vehicle-side detection model Second
bash scripts/dist_train.sh 4 cfgs/v2x_models/second_4class.yaml
Please set arg
TEST_AUGMENTORas True in filesecond_4class.yaml. Then:Python tta_test.py –cfg_file cfgs/v2x_models/second_4class.yaml
-
Merging CenterPoint and Second
Python model_ensemble.py –-result_a <Model A dir> –result_b <Model B dir>
-
Training infrastructure-side detection model PointPillar
Please refer to (https://drive.google.com/file/d/1BO5dbqmLjC3gTjvQTyfEjhIikFz2P_Om/view?usp=sharing)
-
Merging
Please set argument
VEHICLE_RESULT_PATHas the file directory in step3, then :cd ${dair-v2x_root}/dair-v2x/v2x bash scripts/test_lidar_offline_late_fusion.sh 0 offline_fusion 0 0 100
-
Preparation
Download DAIR-V2X dataset first, then make a new file directory and transmit into kitti format:
cp -r data/DAIR-V2X/cooperative-vehicle-infrastructure/vehicle-side data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training python tools/dataset_converter/get_fusion_data_info.py --source-root ./data/DAIR-V2X/cooperative-vehicle-infrastructure --target-root ./data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training rm ./data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training/data_info.json mv ./data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training/fusion_data_info.json ./data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training/data_info.json # Kitti Format cd ${dair-v2x_root}/dair-v2x python tools/dataset_converter/dair2kitti.py --source-root ./data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training \ --target-root ./data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training \ --split-path ./data/split_datas/cooperative-split-data.json \ --label-type lidar --sensor-view cooperative --no-classmerge
-
Centerpoint_pointpainting Inference:
Unzip the result of Painting (painted_lidar_003_fix.zip), then move to
./data/DAIR-V2X/cooperative-vehicle-infrastructure/vic3d-early-fusion-training/trainingThen, begin model inference by TTA:
cd OpenPCDet_DAIR/tools python tta_test.py --cfg_file cfgs/v2x_models/centerpoint_pointpainting.yaml --extra_tag v2xve80_trainval_tta --ckpt ../weight/v2xv_models/centerpoint_pointpainitng/ckpt/checkpoint_epoch_80.pth -
Second Inference
Begin Second inference by TTA :
cd OpenPCDet_DAIR/tools python tta_test.py --cfg_file cfgs/v2x_models/second_4class.yaml --extra_tag v2xve40_trainval_tta --ckpt ../weight/v2xv_models/second_4class /ckpt/checkpoint_epoch_40.pth -
Merging Vehicle-side Inference Result
cd OpenPCDet_DAIR/tools Python model_ensemble.py --cfg_file cfgs/v2x_models/centerpoint_pointpainting.yaml \ --extra_tag centerpointpainting_second4class_testb \ --result_a ../output/v2x_models/centerpoint_pointpainting/v2xve80_trainval_tta/testb_v_tta_ensemble \ --result_b ../output/v2x_models/second_4class/v2xve40_trainval_tta/testb_v_tta_ensembleensemble \ -
Cooperation Inference
-
First, modify the parameter
VEHICLE_RESULT_PATHin thev2x/scripts/test_lidar_offline_late_fusion.shfile to the folder where the results are stored in Step 4, i.e.,"/Yourpath/OpenPCDet/output/v2x_models/model_ensemble/centerpointpainting_second4class_testb"Then, execute the following command:
cd DAIR-V2X/v2x bash scripts/test_lidar_offline_late_fusion.sh 0 offline_fusion 0 0 100