├── .dev_scripts ├── gather_models.py └── linter.sh ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── error-report.md │ ├── feature_request.md │ ├── general_questions.md │ └── reimplementation_questions.md ├── pull_request_template.md └── workflows │ ├── build.yml │ └── deploy.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── LICENSE ├── MANIFEST.in ├── README.md ├── conda_environment.yml ├── configs ├── 3dssd │ ├── 3dssd_4x4_kitti-3d-car.py │ ├── README.md │ └── metafile.yml ├── _base_ │ ├── datasets │ │ ├── coco_instance.py │ │ ├── kitti-3d-3class.py │ │ ├── kitti-3d-car.py │ │ ├── lyft-3d.py │ │ ├── nuim_instance.py │ │ ├── nus-3d.py │ │ ├── nus-mono3d.py │ │ ├── range100_lyft-3d.py │ │ ├── s3dis_seg-3d-13class.py │ │ ├── scannet-3d-18class.py │ │ ├── scannet_seg-3d-20class.py │ │ ├── sunrgbd-3d-10class.py │ │ ├── waymoD5-3d-3class.py │ │ └── waymoD5-3d-car.py │ ├── default_runtime.py │ ├── models │ │ ├── 3dssd.py │ │ ├── cascade_mask_rcnn_r50_fpn.py │ │ ├── centerpoint_01voxel_second_secfpn_nus.py │ │ ├── centerpoint_02pillar_second_secfpn_nus.py │ │ ├── faster_rcnn_r50_fpn.py │ │ ├── fcos3d.py │ │ ├── groupfree3d.py │ │ ├── h3dnet.py │ │ ├── hv_pointpillars_fpn_lyft.py │ │ ├── hv_pointpillars_fpn_nus.py │ │ ├── hv_pointpillars_fpn_range100_lyft.py │ │ ├── hv_pointpillars_secfpn_kitti.py │ │ ├── hv_pointpillars_secfpn_waymo.py │ │ ├── hv_second_secfpn_kitti.py │ │ ├── hv_second_secfpn_waymo.py │ │ ├── imvotenet_image.py │ │ ├── mask_rcnn_r50_fpn.py │ │ ├── parta2.py │ │ ├── pointnet2_msg.py │ │ ├── pointnet2_ssg.py │ │ └── votenet.py │ └── schedules │ │ ├── cosine.py │ │ ├── cyclic_20e.py │ │ ├── cyclic_40e.py │ │ ├── mmdet_schedule_1x.py │ │ ├── schedule_2x.py │ │ ├── schedule_3x.py │ │ ├── seg_cosine_200e.py │ │ └── seg_cosine_50e.py ├── benchmark │ ├── hv_PartA2_secfpn_4x8_cyclic_80e_pcdet_kitti-3d-3class.py │ ├── hv_pointpillars_secfpn_3x8_100e_det3d_kitti-3d-car.py │ ├── hv_pointpillars_secfpn_4x8_80e_pcdet_kitti-3d-3class.py │ └── hv_second_secfpn_4x8_80e_pcdet_kitti-3d-3class.py ├── centerpoint │ ├── README.md │ ├── centerpoint_0075voxel_second_secfpn_4x8_cyclic_20e_nus.py │ ├── centerpoint_0075voxel_second_secfpn_circlenms_4x8_cyclic_20e_nus.py │ ├── centerpoint_0075voxel_second_secfpn_dcn_4x8_cyclic_20e_nus.py │ ├── centerpoint_0075voxel_second_secfpn_dcn_4x8_cyclic_flip-tta_20e_nus.py │ ├── centerpoint_0075voxel_second_secfpn_dcn_4x8_cyclic_tta_20e_nus.py │ ├── centerpoint_0075voxel_second_secfpn_dcn_circlenms_4x8_cyclic_20e_nus.py │ ├── centerpoint_0075voxel_second_secfpn_dcn_circlenms_4x8_cyclic_flip-tta_20e_nus.py │ ├── centerpoint_01voxel_second_secfpn_4x8_cyclic_20e_nus.py │ ├── centerpoint_01voxel_second_secfpn_circlenms_4x8_cyclic_20e_nus.py │ ├── centerpoint_01voxel_second_secfpn_dcn_4x8_cyclic_20e_nus.py │ ├── centerpoint_01voxel_second_secfpn_dcn_circlenms_4x8_cyclic_20e_nus.py │ ├── centerpoint_02pillar_second_secfpn_4x8_cyclic_20e_nus.py │ ├── centerpoint_02pillar_second_secfpn_circlenms_4x8_cyclic_20e_nus.py │ ├── centerpoint_02pillar_second_secfpn_dcn_4x8_cyclic_20e_nus.py │ ├── centerpoint_02pillar_second_secfpn_dcn_circlenms_4x8_cyclic_20e_nus.py │ └── metafile.yml ├── detmatch │ ├── 001 │ │ ├── confthr_frcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ ├── confthr_pvrcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ ├── detmatch │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ ├── pretrain_frcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ └── pretrain_pvrcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ ├── 002 │ │ ├── confthr_frcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ ├── confthr_pvrcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ ├── detmatch │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ ├── pretrain_frcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ │ └── pretrain_pvrcnn │ │ │ ├── split_0.py │ │ │ ├── split_1.py │ │ │ └── split_2.py │ └── 020 │ │ ├── confthr_frcnn │ │ ├── split_0.py │ │ ├── split_1.py │ │ └── split_2.py │ │ ├── confthr_pvrcnn │ │ ├── split_0.py │ │ ├── split_1.py │ │ └── split_2.py │ │ ├── detmatch │ │ ├── split_0.py │ │ ├── split_1.py │ │ └── split_2.py │ │ ├── pretrain_frcnn │ │ ├── split_0.py │ │ ├── split_1.py │ │ └── split_2.py │ │ └── pretrain_pvrcnn │ │ ├── split_0.py │ │ ├── split_1.py │ │ └── split_2.py ├── dynamic_voxelization │ ├── README.md │ ├── dv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py │ ├── dv_second_secfpn_2x8_cosine_80e_kitti-3d-3class.py │ ├── dv_second_secfpn_6x8_80e_kitti-3d-car.py │ └── metafile.yml ├── fcos3d │ ├── README.md │ ├── fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d.py │ ├── fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d_finetune.py │ └── metafile.yml ├── fp16 │ ├── README.md │ ├── hv_pointpillars_fpn_sbn-all_fp16_2x8_2x_nus-3d.py │ ├── hv_pointpillars_regnet-400mf_fpn_sbn-all_fp16_2x8_2x_nus-3d.py │ ├── hv_pointpillars_secfpn_sbn-all_fp16_2x8_2x_nus-3d.py │ ├── hv_second_secfpn_fp16_6x8_80e_kitti-3d-3class.py │ ├── hv_second_secfpn_fp16_6x8_80e_kitti-3d-car.py │ └── metafile.yml ├── free_anchor │ ├── README.md │ ├── hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py │ ├── hv_pointpillars_regnet-1.6gf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py │ ├── hv_pointpillars_regnet-1.6gf_fpn_sbn-all_free-anchor_strong-aug_4x8_3x_nus-3d.py │ ├── hv_pointpillars_regnet-3.2gf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py │ ├── hv_pointpillars_regnet-3.2gf_fpn_sbn-all_free-anchor_strong-aug_4x8_3x_nus-3d.py │ ├── hv_pointpillars_regnet-400mf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py │ └── metafile.yml ├── groupfree3d │ ├── groupfree3d_8x4_scannet-3d-18class-L12-O256.py │ ├── groupfree3d_8x4_scannet-3d-18class-L6-O256.py │ ├── groupfree3d_8x4_scannet-3d-18class-w2x-L12-O256.py │ └── groupfree3d_8x4_scannet-3d-18class-w2x-L12-O512.py ├── h3dnet │ ├── README.md │ ├── h3dnet_3x8_scannet-3d-18class.py │ └── metafile.yml ├── imvotenet │ ├── README.md │ ├── imvotenet_faster_rcnn_r50_fpn_2x4_sunrgbd-3d-10class.py │ ├── imvotenet_stage2_16x8_sunrgbd-3d-10class.py │ └── metafile.yml ├── imvoxelnet │ ├── README.md │ ├── imvoxelnet_kitti-3d-car.py │ └── metafile.yml ├── mvxnet │ ├── README.md │ ├── dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class.py │ └── metafile.yml ├── nuimages │ ├── README.md │ ├── cascade_mask_rcnn_r101_fpn_1x_nuim.py │ ├── cascade_mask_rcnn_r50_fpn_1x_nuim.py │ ├── cascade_mask_rcnn_r50_fpn_coco-20e_1x_nuim.py │ ├── cascade_mask_rcnn_r50_fpn_coco-20e_20e_nuim.py │ ├── cascade_mask_rcnn_x101_32x4d_fpn_1x_nuim.py │ ├── htc_r50_fpn_1x_nuim.py │ ├── htc_r50_fpn_coco-20e_1x_nuim.py │ ├── htc_r50_fpn_coco-20e_20e_nuim.py │ ├── htc_without_semantic_r50_fpn_1x_nuim.py │ ├── htc_x101_64x4d_fpn_dconv_c3-c5_coco-20e_16x1_20e_nuim.py │ ├── mask_rcnn_r101_fpn_1x_nuim.py │ ├── mask_rcnn_r50_caffe_fpn_1x_nuim.py │ ├── mask_rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py │ ├── mask_rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py │ ├── mask_rcnn_r50_fpn_1x_nuim.py │ ├── mask_rcnn_r50_fpn_coco-2x_1x_nuim.py │ ├── mask_rcnn_r50_fpn_coco-2x_1x_nus-2d.py │ ├── mask_rcnn_x101_32x4d_fpn_1x_nuim.py │ └── metafile.yml ├── parta2 │ ├── README.md │ ├── hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-3class.py │ ├── hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-car.py │ └── metafile.yml ├── pointnet2 │ ├── README.md │ ├── metafile.yml │ ├── pointnet2_msg_16x2_cosine_250e_scannet_seg-3d-20class.py │ ├── pointnet2_msg_16x2_cosine_80e_s3dis_seg-3d-13class.py │ ├── pointnet2_msg_xyz-only_16x2_cosine_250e_scannet_seg-3d-20class.py │ ├── pointnet2_ssg_16x2_cosine_200e_scannet_seg-3d-20class.py │ ├── pointnet2_ssg_16x2_cosine_50e_s3dis_seg-3d-13class.py │ └── pointnet2_ssg_xyz-only_16x2_cosine_200e_scannet_seg-3d-20class.py ├── pointpillars │ ├── README.md │ ├── hv_pointpillars_fpn_sbn-all_2x8_2x_lyft-3d.py │ ├── hv_pointpillars_fpn_sbn-all_4x8_2x_nus-3d.py │ ├── hv_pointpillars_fpn_sbn-all_range100_2x8_2x_lyft-3d.py │ ├── hv_pointpillars_secfpn_6x8_160e_kitti-3d-3class.py │ ├── hv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py │ ├── hv_pointpillars_secfpn_sbn-all_2x8_2x_lyft-3d.py │ ├── hv_pointpillars_secfpn_sbn-all_4x8_2x_nus-3d.py │ ├── hv_pointpillars_secfpn_sbn-all_range100_2x8_2x_lyft-3d.py │ ├── hv_pointpillars_secfpn_sbn_2x16_2x_waymo-3d-3class.py │ ├── hv_pointpillars_secfpn_sbn_2x16_2x_waymo-3d-car.py │ ├── hv_pointpillars_secfpn_sbn_2x16_2x_waymoD5-3d-3class.py │ ├── hv_pointpillars_secfpn_sbn_2x16_2x_waymoD5-3d-car.py │ └── metafile.yml ├── regnet │ ├── README.md │ ├── hv_pointpillars_regnet-1.6gf_fpn_sbn-all_4x8_2x_nus-3d.py │ ├── hv_pointpillars_regnet-400mf_fpn_sbn-all_2x8_2x_lyft-3d.py │ ├── hv_pointpillars_regnet-400mf_fpn_sbn-all_4x8_2x_nus-3d.py │ ├── hv_pointpillars_regnet-400mf_fpn_sbn-all_range100_2x8_2x_lyft-3d.py │ ├── hv_pointpillars_regnet-400mf_secfpn_sbn-all_2x8_2x_lyft-3d.py │ ├── hv_pointpillars_regnet-400mf_secfpn_sbn-all_4x8_2x_nus-3d.py │ ├── hv_pointpillars_regnet-400mf_secfpn_sbn-all_range100_2x8_2x_lyft-3d.py │ └── metafile.yml ├── second │ ├── README.md │ ├── hv_second_secfpn_6x8_80e_kitti-3d-3class.py │ ├── hv_second_secfpn_6x8_80e_kitti-3d-car.py │ ├── hv_second_secfpn_sbn_2x16_2x_waymoD5-3d-3class.py │ └── metafile.yml ├── ssn │ ├── README.md │ ├── hv_ssn_regnet-400mf_secfpn_sbn-all_1x16_2x_lyft-3d.py │ ├── hv_ssn_regnet-400mf_secfpn_sbn-all_2x16_2x_nus-3d.py │ ├── hv_ssn_secfpn_sbn-all_2x16_2x_lyft-3d.py │ ├── hv_ssn_secfpn_sbn-all_2x16_2x_nus-3d.py │ └── metafile.yml └── votenet │ ├── README.md │ ├── metafile.yml │ ├── votenet_16x8_sunrgbd-3d-10class.py │ ├── votenet_8x8_scannet-3d-18class.py │ └── votenet_iouloss_8x8_scannet-3d-18class.py ├── data ├── lyft │ ├── test.txt │ ├── train.txt │ └── val.txt ├── s3dis │ ├── README.md │ ├── collect_indoor3d_data.py │ ├── indoor3d_util.py │ └── meta_data │ │ ├── anno_paths.txt │ │ └── class_names.txt ├── scannet │ ├── README.md │ ├── batch_load_scannet_data.py │ ├── load_scannet_data.py │ ├── meta_data │ │ ├── scannet_means.npz │ │ ├── scannet_train.txt │ │ ├── scannetv2-labels.combined.tsv │ │ ├── scannetv2_test.txt │ │ ├── scannetv2_train.txt │ │ └── scannetv2_val.txt │ └── scannet_utils.py └── sunrgbd │ ├── README.md │ └── matlab │ ├── extract_rgbd_data_v1.m │ ├── extract_rgbd_data_v2.m │ └── extract_split.m ├── demo ├── data │ ├── kitti │ │ ├── kitti_000008.bin │ │ ├── kitti_000008.png │ │ └── kitti_000008_infos.pkl │ ├── nuscenes │ │ ├── n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525.jpg │ │ └── n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525_mono3d.coco.json │ ├── scannet │ │ └── scene0000_00.bin │ └── sunrgbd │ │ ├── sunrgbd_000017.bin │ │ ├── sunrgbd_000017.jpg │ │ └── sunrgbd_000017_infos.pkl ├── inference_demo.ipynb ├── mono_det_demo.py ├── multi_modality_demo.py ├── pc_seg_demo.py └── pcd_demo.py ├── docker └── Dockerfile ├── docs ├── 1_exist_data_model.md ├── 2_new_data_model.md ├── Makefile ├── api.rst ├── benchmarks.md ├── changelog.md ├── compatibility.md ├── conf.py ├── data_preparation.md ├── datasets │ ├── index.rst │ ├── scannet_det.md │ └── waymo_det.md ├── demo.md ├── faq.md ├── getting_started.md ├── index.rst ├── make.bat ├── model_zoo.md ├── stat.py ├── supported_tasks │ ├── index.rst │ ├── lidar_det3d.md │ ├── lidar_sem_seg3d.md │ └── vision_det3d.md ├── switch_language.md ├── tutorials │ ├── config.md │ ├── customize_dataset.md │ ├── customize_models.md │ ├── customize_runtime.md │ ├── data_pipeline.md │ └── index.rst └── useful_tools.md ├── docs_zh-CN ├── 0_demo.md ├── 1_exist_data_model.md ├── 2_new_data_model.md ├── Makefile ├── api.rst ├── conf.py ├── data_preparation.md ├── faq.md ├── getting_started.md ├── index.rst ├── make.bat ├── model_zoo.md ├── stat.py ├── switch_language.md ├── tutorials │ ├── config.md │ ├── customize_dataset.md │ ├── customize_models.md │ ├── customize_runtime.md │ ├── data_pipeline.md │ ├── index.rst │ └── waymo.md └── useful_tools.md ├── mmdet3d ├── __init__.py ├── apis │ ├── __init__.py │ ├── inference.py │ ├── ssl_train.py │ ├── test.py │ └── train.py ├── core │ ├── __init__.py │ ├── anchor │ │ ├── __init__.py │ │ └── anchor_3d_generator.py │ ├── bbox │ │ ├── __init__.py │ │ ├── assigners │ │ │ ├── __init__.py │ │ │ └── modified_hungarian_assigner.py │ │ ├── box_np_ops.py │ │ ├── coders │ │ │ ├── __init__.py │ │ │ ├── anchor_free_bbox_coder.py │ │ │ ├── centerpoint_bbox_coders.py │ │ │ ├── delta_xyzwhlr_bbox_coder.py │ │ │ ├── groupfree3d_bbox_coder.py │ │ │ └── partial_bin_based_bbox_coder.py │ │ ├── iou_calculators │ │ │ ├── __init__.py │ │ │ └── iou3d_calculator.py │ │ ├── match_costs │ │ │ ├── __init__.py │ │ │ └── modified_match_cost.py │ │ ├── samplers │ │ │ ├── __init__.py │ │ │ └── iou_neg_piecewise_sampler.py │ │ ├── structures │ │ │ ├── __init__.py │ │ │ ├── base_box3d.py │ │ │ ├── box_3d_mode.py │ │ │ ├── cam_box3d.py │ │ │ ├── coord_3d_mode.py │ │ │ ├── depth_box3d.py │ │ │ ├── lidar_box3d.py │ │ │ └── utils.py │ │ └── transforms.py │ ├── evaluation │ │ ├── __init__.py │ │ ├── indoor_eval.py │ │ ├── kitti_utils │ │ │ ├── __init__.py │ │ │ ├── eval.py │ │ │ └── rotate_iou.py │ │ ├── lyft_eval.py │ │ ├── seg_eval.py │ │ └── waymo_utils │ │ │ └── prediction_kitti_to_waymo.py │ ├── optimizer │ │ ├── __init__.py │ │ ├── hybrid_constructor.py │ │ └── hybrid_optimizer.py │ ├── points │ │ ├── __init__.py │ │ ├── base_points.py │ │ ├── cam_points.py │ │ ├── depth_points.py │ │ └── lidar_points.py │ ├── post_processing │ │ ├── __init__.py │ │ ├── box3d_nms.py │ │ └── merge_augs.py │ ├── runner │ │ └── iter_based_ssl_runner.py │ ├── utils │ │ ├── __init__.py │ │ ├── frozen_bn.py │ │ ├── gaussian.py │ │ ├── gradient_cumulative.py │ │ ├── model_iter_epoch.py │ │ ├── multi_step_multi_lr.py │ │ └── wandb_vis_hook.py │ ├── visualizer │ │ ├── __init__.py │ │ ├── image_vis.py │ │ ├── open3d_vis.py │ │ └── show_result.py │ └── voxel │ │ ├── __init__.py │ │ ├── builder.py │ │ └── voxel_generator.py ├── datasets │ ├── __init__.py │ ├── builder.py │ ├── custom_3d.py │ ├── custom_3d_seg.py │ ├── dataset_wrappers.py │ ├── kitti2d_dataset.py │ ├── kitti_dataset.py │ ├── kitti_mono_dataset.py │ ├── lyft_dataset.py │ ├── nuscenes_dataset.py │ ├── nuscenes_mono_dataset.py │ ├── pipelines │ │ ├── __init__.py │ │ ├── data_augment_utils.py │ │ ├── dbsampler.py │ │ ├── formating.py │ │ ├── loading.py │ │ ├── test_time_aug.py │ │ ├── torchvision_transforms.py │ │ └── transforms_3d.py │ ├── s3dis_dataset.py │ ├── scannet_dataset.py │ ├── semantickitti_dataset.py │ ├── sunrgbd_dataset.py │ ├── teacher_student_ssl_dataset.py │ ├── utils.py │ └── waymo_dataset.py ├── models │ ├── __init__.py │ ├── backbones │ │ ├── __init__.py │ │ ├── base_pointnet.py │ │ ├── multi_backbone.py │ │ ├── nostem_regnet.py │ │ ├── pointnet2_sa_msg.py │ │ ├── pointnet2_sa_ssg.py │ │ └── second.py │ ├── builder.py │ ├── decode_heads │ │ ├── __init__.py │ │ ├── decode_head.py │ │ └── pointnet2_head.py │ ├── dense_heads │ │ ├── __init__.py │ │ ├── anchor3d_head.py │ │ ├── anchor_free_mono3d_head.py │ │ ├── base_conv_bbox_head.py │ │ ├── base_mono3d_dense_head.py │ │ ├── centerpoint_head.py │ │ ├── fcos_mono3d_head.py │ │ ├── free_anchor3d_head.py │ │ ├── groupfree3d_head.py │ │ ├── parta2_rpn_head.py │ │ ├── shape_aware_head.py │ │ ├── ssd_3d_head.py │ │ ├── train_mixins.py │ │ └── vote_head.py │ ├── detectors │ │ ├── __init__.py │ │ ├── base.py │ │ ├── centerpoint.py │ │ ├── dynamic_voxelnet.py │ │ ├── fcos_mono3d.py │ │ ├── groupfree3dnet.py │ │ ├── h3dnet.py │ │ ├── imvotenet.py │ │ ├── imvoxelnet.py │ │ ├── mmdetector.py │ │ ├── mvx_faster_rcnn.py │ │ ├── mvx_two_stage.py │ │ ├── openpcdet.py │ │ ├── parta2.py │ │ ├── single_stage.py │ │ ├── single_stage_mono3d.py │ │ ├── ssd3dnet.py │ │ ├── ssl.py │ │ ├── two_stage.py │ │ ├── votenet.py │ │ └── voxelnet.py │ ├── fusion_layers │ │ ├── __init__.py │ │ ├── coord_transform.py │ │ ├── point_fusion.py │ │ └── vote_fusion.py │ ├── losses │ │ ├── __init__.py │ │ ├── axis_aligned_iou_loss.py │ │ ├── chamfer_distance.py │ │ └── softmax_focal_loss.py │ ├── middle_encoders │ │ ├── __init__.py │ │ ├── pillar_scatter.py │ │ ├── sparse_encoder.py │ │ └── sparse_unet.py │ ├── model_utils │ │ ├── __init__.py │ │ ├── transformer.py │ │ └── vote_module.py │ ├── necks │ │ ├── __init__.py │ │ ├── imvoxel_neck.py │ │ └── second_fpn.py │ ├── roi_heads │ │ ├── __init__.py │ │ ├── base_3droi_head.py │ │ ├── bbox_heads │ │ │ ├── __init__.py │ │ │ ├── h3d_bbox_head.py │ │ │ └── parta2_bbox_head.py │ │ ├── h3d_roi_head.py │ │ ├── mask_heads │ │ │ ├── __init__.py │ │ │ ├── pointwise_semantic_head.py │ │ │ └── primitive_head.py │ │ ├── part_aggregation_roi_head.py │ │ └── roi_extractors │ │ │ ├── __init__.py │ │ │ └── single_roiaware_extractor.py │ ├── segmentors │ │ ├── __init__.py │ │ ├── base.py │ │ └── encoder_decoder.py │ ├── ssl_modules │ │ ├── __init__.py │ │ ├── bbox_utils.py │ │ ├── consumers │ │ │ ├── __init__.py │ │ │ ├── consumers_2d.py │ │ │ ├── consumers_3d.py │ │ │ ├── metrics.py │ │ │ ├── openpcdet.py │ │ │ └── visualize.py │ │ ├── processors │ │ │ ├── __init__.py │ │ │ ├── processors_2d.py │ │ │ ├── processors_3d.py │ │ │ └── processors_fusion.py │ │ └── utils.py │ ├── utils │ │ ├── __init__.py │ │ ├── clip_sigmoid.py │ │ └── mlp.py │ └── voxel_encoders │ │ ├── __init__.py │ │ ├── pillar_encoder.py │ │ ├── utils.py │ │ └── voxel_encoder.py ├── ops │ ├── __init__.py │ ├── ball_query │ │ ├── __init__.py │ │ ├── ball_query.py │ │ └── src │ │ │ ├── ball_query.cpp │ │ │ └── ball_query_cuda.cu │ ├── furthest_point_sample │ │ ├── __init__.py │ │ ├── furthest_point_sample.py │ │ ├── points_sampler.py │ │ ├── src │ │ │ ├── furthest_point_sample.cpp │ │ │ └── furthest_point_sample_cuda.cu │ │ └── utils.py │ ├── gather_points │ │ ├── __init__.py │ │ ├── gather_points.py │ │ └── src │ │ │ ├── gather_points.cpp │ │ │ └── gather_points_cuda.cu │ ├── group_points │ │ ├── __init__.py │ │ ├── group_points.py │ │ └── src │ │ │ ├── group_points.cpp │ │ │ └── group_points_cuda.cu │ ├── interpolate │ │ ├── __init__.py │ │ ├── src │ │ │ ├── interpolate.cpp │ │ │ ├── three_interpolate_cuda.cu │ │ │ └── three_nn_cuda.cu │ │ ├── three_interpolate.py │ │ └── three_nn.py │ ├── iou3d │ │ ├── __init__.py │ │ ├── iou3d_utils.py │ │ └── src │ │ │ ├── iou3d.cpp │ │ │ └── iou3d_kernel.cu │ ├── knn │ │ ├── __init__.py │ │ ├── knn.py │ │ └── src │ │ │ ├── knn.cpp │ │ │ └── knn_cuda.cu │ ├── norm.py │ ├── paconv │ │ ├── __init__.py │ │ ├── assign_score.py │ │ ├── paconv.py │ │ ├── src │ │ │ ├── assign_score_withk.cpp │ │ │ └── assign_score_withk_cuda.cu │ │ └── utils.py │ ├── pointnet_modules │ │ ├── __init__.py │ │ ├── builder.py │ │ ├── paconv_sa_module.py │ │ ├── point_fp_module.py │ │ └── point_sa_module.py │ ├── roiaware_pool3d │ │ ├── __init__.py │ │ ├── points_in_boxes.py │ │ ├── roiaware_pool3d.py │ │ └── src │ │ │ ├── points_in_boxes_cpu.cpp │ │ │ ├── points_in_boxes_cuda.cu │ │ │ ├── roiaware_pool3d.cpp │ │ │ └── roiaware_pool3d_kernel.cu │ ├── sparse_block.py │ ├── spconv │ │ ├── __init__.py │ │ ├── conv.py │ │ ├── functional.py │ │ ├── include │ │ │ ├── paramsgrid.h │ │ │ ├── prettyprint.h │ │ │ ├── pybind11_utils.h │ │ │ ├── spconv │ │ │ │ ├── fused_spconv_ops.h │ │ │ │ ├── geometry.h │ │ │ │ ├── indice.cu.h │ │ │ │ ├── indice.h │ │ │ │ ├── maxpool.h │ │ │ │ ├── mp_helper.h │ │ │ │ ├── point2voxel.h │ │ │ │ ├── pool_ops.h │ │ │ │ ├── reordering.cu.h │ │ │ │ ├── reordering.h │ │ │ │ └── spconv_ops.h │ │ │ ├── tensorview │ │ │ │ ├── helper_kernel.cu.h │ │ │ │ ├── helper_launch.h │ │ │ │ └── tensorview.h │ │ │ ├── torch_utils.h │ │ │ └── utility │ │ │ │ └── timer.h │ │ ├── modules.py │ │ ├── ops.py │ │ ├── pool.py │ │ ├── src │ │ │ ├── all.cc │ │ │ ├── indice.cc │ │ │ ├── indice_cuda.cu │ │ │ ├── maxpool.cc │ │ │ ├── maxpool_cuda.cu │ │ │ ├── reordering.cc │ │ │ └── reordering_cuda.cu │ │ ├── structure.py │ │ └── test_utils.py │ └── voxel │ │ ├── __init__.py │ │ ├── scatter_points.py │ │ ├── src │ │ ├── scatter_points_cpu.cpp │ │ ├── scatter_points_cuda.cu │ │ ├── voxelization.cpp │ │ ├── voxelization.h │ │ ├── voxelization_cpu.cpp │ │ └── voxelization_cuda.cu │ │ └── voxelize.py ├── utils │ ├── __init__.py │ ├── collect_env.py │ └── logger.py └── version.py ├── model-index.yml ├── requirements.txt ├── requirements ├── build.txt ├── docs.txt ├── mminstall.txt ├── optional.txt ├── readthedocs.txt ├── runtime.txt └── tests.txt ├── resources ├── browse_dataset_mono.png ├── browse_dataset_multi_modality.png ├── browse_dataset_seg.png ├── data_pipeline.png ├── loss_curve.png ├── mmdet3d-logo.png ├── mmdet3d_outdoor_demo.gif ├── nuimages_demo.gif ├── open3d_visual.gif ├── qq_group_qrcode.jpg └── zhihu_qrcode.jpg ├── setup.cfg ├── setup.py ├── teaser.png ├── tests ├── data │ ├── kitti │ │ ├── a.bin │ │ ├── kitti_dbinfos_train.pkl │ │ ├── kitti_gt_database │ │ │ └── 0_Pedestrian_0.bin │ │ ├── kitti_infos_mono3d.coco.json │ │ ├── kitti_infos_mono3d.pkl │ │ ├── kitti_infos_train.pkl │ │ ├── mono3d_sample_results.pkl │ │ ├── mono3d_sample_results2d.pkl │ │ └── training │ │ │ ├── image_2 │ │ │ ├── 000000.png │ │ │ └── 000007.png │ │ │ ├── velodyne │ │ │ └── 000000.bin │ │ │ └── velodyne_reduced │ │ │ └── 000000.bin │ ├── lyft │ │ ├── lidar │ │ │ ├── host-a017_lidar1_1236118886501000046.bin │ │ │ ├── host-a017_lidar1_1236118886701083686.bin │ │ │ └── host-a017_lidar1_1236118886901125926.bin │ │ ├── lyft_infos.pkl │ │ ├── lyft_infos_val.pkl │ │ ├── sample_results.pkl │ │ ├── v1.01-train │ │ │ ├── maps │ │ │ │ └── map_raster_palo_alto.png │ │ │ └── v1.01-train │ │ │ │ ├── attribute.json │ │ │ │ ├── calibrated_sensor.json │ │ │ │ ├── category.json │ │ │ │ ├── ego_pose.json │ │ │ │ ├── instance.json │ │ │ │ ├── log.json │ │ │ │ ├── map.json │ │ │ │ ├── sample.json │ │ │ │ ├── sample_annotation.json │ │ │ │ ├── sample_data.json │ │ │ │ ├── scene.json │ │ │ │ ├── sensor.json │ │ │ │ └── visibility.json │ │ └── val.txt │ ├── nuscenes │ │ ├── mono3d_sample_results.pkl │ │ ├── nus_info.pkl │ │ ├── nus_infos_mono3d.coco.json │ │ ├── samples │ │ │ ├── CAM_BACK_LEFT │ │ │ │ └── n015-2018-07-18-11-07-57+0800__CAM_BACK_LEFT__1531883530447423.jpg │ │ │ └── LIDAR_TOP │ │ │ │ └── n015-2018-08-02-17-16-37+0800__LIDAR_TOP__1533201470948018.pcd.bin │ │ └── sweeps │ │ │ └── LIDAR_TOP │ │ │ ├── n008-2018-09-18-12-07-26-0400__LIDAR_TOP__1537287083900561.pcd.bin │ │ │ └── n015-2018-08-02-17-16-37+0800__LIDAR_TOP__1533201470898274.pcd.bin │ ├── ops │ │ ├── features_for_fps_distance.npy │ │ └── fps_idx.npy │ ├── s3dis │ │ ├── instance_mask │ │ │ └── Area_1_office_2.bin │ │ ├── points │ │ │ └── Area_1_office_2.bin │ │ ├── s3dis_infos.pkl │ │ └── semantic_mask │ │ │ └── Area_1_office_2.bin │ ├── scannet │ │ ├── instance_mask │ │ │ └── scene0000_00.bin │ │ ├── points │ │ │ └── scene0000_00.bin │ │ ├── scannet_infos.pkl │ │ └── semantic_mask │ │ │ └── scene0000_00.bin │ ├── semantickitti │ │ ├── semantickitti_infos.pkl │ │ └── sequences │ │ │ └── 00 │ │ │ ├── labels │ │ │ └── 000000.label │ │ │ └── velodyne │ │ │ └── 000000.bin │ ├── sunrgbd │ │ ├── points │ │ │ └── 000001.bin │ │ ├── sunrgbd_infos.pkl │ │ └── sunrgbd_trainval │ │ │ └── image │ │ │ └── 000001.jpg │ └── waymo │ │ ├── kitti_format │ │ ├── training │ │ │ ├── image_0 │ │ │ │ ├── 0000000.png │ │ │ │ └── 1000000.png │ │ │ └── velodyne │ │ │ │ ├── 0000000.bin │ │ │ │ └── 1000000.bin │ │ ├── waymo_dbinfos_train.pkl │ │ ├── waymo_gt_database │ │ │ └── 0_Car_0.bin │ │ ├── waymo_infos_train.pkl │ │ └── waymo_infos_val.pkl │ │ └── waymo_format │ │ ├── gt.bin │ │ └── validation │ │ └── val.tfrecord ├── test_data │ ├── test_datasets │ │ ├── test_dataset_wrappers.py │ │ ├── test_kitti_dataset.py │ │ ├── test_kitti_mono_dataset.py │ │ ├── test_lyft_dataset.py │ │ ├── test_nuscene_dataset.py │ │ ├── test_nuscenes_mono_dataset.py │ │ ├── test_s3dis_dataset.py │ │ ├── test_scannet_dataset.py │ │ ├── test_semantickitti_dataset.py │ │ ├── test_sunrgbd_dataset.py │ │ └── test_waymo_dataset.py │ └── test_pipelines │ │ ├── test_augmentations │ │ ├── test_data_augment_utils.py │ │ ├── test_test_augment_utils.py │ │ └── test_transforms_3d.py │ │ ├── test_indoor_pipeline.py │ │ ├── test_indoor_sample.py │ │ ├── test_loadings │ │ ├── test_load_images_from_multi_views.py │ │ ├── test_load_points_from_multi_sweeps.py │ │ └── test_loading.py │ │ └── test_outdoor_pipeline.py ├── test_metrics │ ├── test_indoor_eval.py │ ├── test_kitti_eval.py │ ├── test_losses.py │ └── test_seg_eval.py ├── test_models │ ├── test_backbones.py │ ├── test_common_modules │ │ ├── test_middle_encoders.py │ │ ├── test_paconv_modules.py │ │ ├── test_paconv_ops.py │ │ ├── test_pointnet_modules.py │ │ ├── test_pointnet_ops.py │ │ ├── test_roiaware_pool3d.py │ │ ├── test_sparse_unet.py │ │ └── test_vote_module.py │ ├── test_detectors.py │ ├── test_forward.py │ ├── test_fusion │ │ ├── test_fusion_coord_trans.py │ │ ├── test_point_fusion.py │ │ └── test_vote_fusion.py │ ├── test_heads │ │ ├── test_heads.py │ │ ├── test_parta2_bbox_head.py │ │ ├── test_pointnet2_decode_head.py │ │ ├── test_roi_extractors.py │ │ └── test_semantic_heads.py │ ├── test_necks │ │ ├── test_fpn.py │ │ └── test_necks.py │ ├── test_segmentors.py │ └── test_voxel_encoder │ │ ├── test_dynamic_scatter.py │ │ ├── test_voxel_encoders.py │ │ ├── test_voxel_generator.py │ │ └── test_voxelize.py ├── test_runtime │ ├── test_apis.py │ └── test_config.py ├── test_samples │ └── parta2_roihead_inputs.npz ├── test_ssl │ └── test_ssl_dataset.py └── test_utils │ ├── test_anchors.py │ ├── test_assigners.py │ ├── test_bbox_coders.py │ ├── test_box3d.py │ ├── test_box_np_ops.py │ ├── test_coord_3d_mode.py │ ├── test_merge_augs.py │ ├── test_nms.py │ ├── test_points.py │ ├── test_samplers.py │ └── test_utils.py ├── thirdparty └── Spconv-OpenPCDet │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── docs │ ├── DEMO.md │ ├── GETTING_STARTED.md │ └── INSTALL.md │ ├── pcdet │ ├── __init__.py │ ├── config.py │ ├── datasets │ │ ├── __init__.py │ │ ├── augmentor │ │ │ ├── augmentor_utils.py │ │ │ ├── data_augmentor.py │ │ │ └── database_sampler.py │ │ ├── dataset.py │ │ ├── kitti │ │ │ ├── kitti_dataset.py │ │ │ ├── kitti_object_eval_python │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── eval.py │ │ │ │ ├── evaluate.py │ │ │ │ ├── kitti_common.py │ │ │ │ └── rotate_iou.py │ │ │ └── kitti_utils.py │ │ ├── nuscenes │ │ │ ├── nuscenes_dataset.py │ │ │ └── nuscenes_utils.py │ │ ├── processor │ │ │ ├── data_processor.py │ │ │ └── point_feature_encoder.py │ │ └── waymo │ │ │ ├── waymo_dataset.py │ │ │ ├── waymo_eval.py │ │ │ └── waymo_utils.py │ ├── models │ │ ├── __init__.py │ │ ├── backbones_2d │ │ │ ├── __init__.py │ │ │ ├── base_bev_backbone.py │ │ │ └── map_to_bev │ │ │ │ ├── __init__.py │ │ │ │ ├── conv2d_collapse.py │ │ │ │ ├── height_compression.py │ │ │ │ └── pointpillar_scatter.py │ │ ├── backbones_3d │ │ │ ├── __init__.py │ │ │ ├── pfe │ │ │ │ ├── __init__.py │ │ │ │ └── voxel_set_abstraction.py │ │ │ ├── pointnet2_backbone.py │ │ │ ├── spconv_backbone.py │ │ │ ├── spconv_unet.py │ │ │ └── vfe │ │ │ │ ├── __init__.py │ │ │ │ ├── image_vfe.py │ │ │ │ ├── image_vfe_modules │ │ │ │ ├── f2v │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── frustum_grid_generator.py │ │ │ │ │ ├── frustum_to_voxel.py │ │ │ │ │ └── sampler.py │ │ │ │ └── ffn │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── ddn │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── ddn_deeplabv3.py │ │ │ │ │ └── ddn_template.py │ │ │ │ │ ├── ddn_loss │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── balancer.py │ │ │ │ │ └── ddn_loss.py │ │ │ │ │ └── depth_ffn.py │ │ │ │ ├── mean_vfe.py │ │ │ │ ├── pillar_vfe.py │ │ │ │ └── vfe_template.py │ │ ├── dense_heads │ │ │ ├── __init__.py │ │ │ ├── anchor_head_multi.py │ │ │ ├── anchor_head_single.py │ │ │ ├── anchor_head_template.py │ │ │ ├── point_head_box.py │ │ │ ├── point_head_simple.py │ │ │ ├── point_head_template.py │ │ │ ├── point_intra_part_head.py │ │ │ └── target_assigner │ │ │ │ ├── anchor_generator.py │ │ │ │ ├── atss_target_assigner.py │ │ │ │ └── axis_aligned_target_assigner.py │ │ ├── detectors │ │ │ ├── PartA2_net.py │ │ │ ├── __init__.py │ │ │ ├── caddn.py │ │ │ ├── detector3d_template.py │ │ │ ├── point_rcnn.py │ │ │ ├── pointpillar.py │ │ │ ├── pv_rcnn.py │ │ │ ├── second_net.py │ │ │ ├── second_net_iou.py │ │ │ └── voxel_rcnn.py │ │ ├── model_utils │ │ │ ├── basic_block_2d.py │ │ │ └── model_nms_utils.py │ │ └── roi_heads │ │ │ ├── __init__.py │ │ │ ├── partA2_head.py │ │ │ ├── pointrcnn_head.py │ │ │ ├── pvrcnn_head.py │ │ │ ├── roi_head_template.py │ │ │ ├── second_head.py │ │ │ ├── target_assigner │ │ │ └── proposal_target_layer.py │ │ │ └── voxelrcnn_head.py │ ├── ops │ │ ├── iou3d_nms │ │ │ ├── iou3d_nms_utils.py │ │ │ └── src │ │ │ │ ├── iou3d_cpu.cpp │ │ │ │ ├── iou3d_cpu.h │ │ │ │ ├── iou3d_nms.cpp │ │ │ │ ├── iou3d_nms.h │ │ │ │ ├── iou3d_nms_api.cpp │ │ │ │ └── iou3d_nms_kernel.cu │ │ ├── pointnet2 │ │ │ ├── pointnet2_batch │ │ │ │ ├── pointnet2_modules.py │ │ │ │ ├── pointnet2_utils.py │ │ │ │ └── src │ │ │ │ │ ├── ball_query.cpp │ │ │ │ │ ├── ball_query_gpu.cu │ │ │ │ │ ├── ball_query_gpu.h │ │ │ │ │ ├── cuda_utils.h │ │ │ │ │ ├── group_points.cpp │ │ │ │ │ ├── group_points_gpu.cu │ │ │ │ │ ├── group_points_gpu.h │ │ │ │ │ ├── interpolate.cpp │ │ │ │ │ ├── interpolate_gpu.cu │ │ │ │ │ ├── interpolate_gpu.h │ │ │ │ │ ├── pointnet2_api.cpp │ │ │ │ │ ├── sampling.cpp │ │ │ │ │ ├── sampling_gpu.cu │ │ │ │ │ └── sampling_gpu.h │ │ │ └── pointnet2_stack │ │ │ │ ├── pointnet2_modules.py │ │ │ │ ├── pointnet2_utils.py │ │ │ │ ├── src │ │ │ │ ├── ball_query.cpp │ │ │ │ ├── ball_query_gpu.cu │ │ │ │ ├── ball_query_gpu.h │ │ │ │ ├── cuda_utils.h │ │ │ │ ├── group_points.cpp │ │ │ │ ├── group_points_gpu.cu │ │ │ │ ├── group_points_gpu.h │ │ │ │ ├── interpolate.cpp │ │ │ │ ├── interpolate_gpu.cu │ │ │ │ ├── interpolate_gpu.h │ │ │ │ ├── pointnet2_api.cpp │ │ │ │ ├── sampling.cpp │ │ │ │ ├── sampling_gpu.cu │ │ │ │ ├── sampling_gpu.h │ │ │ │ ├── voxel_query.cpp │ │ │ │ ├── voxel_query_gpu.cu │ │ │ │ └── voxel_query_gpu.h │ │ │ │ ├── voxel_pool_modules.py │ │ │ │ └── voxel_query_utils.py │ │ ├── roiaware_pool3d │ │ │ ├── roiaware_pool3d_utils.py │ │ │ └── src │ │ │ │ ├── roiaware_pool3d.cpp │ │ │ │ └── roiaware_pool3d_kernel.cu │ │ ├── roipoint_pool3d │ │ │ ├── roipoint_pool3d_utils.py │ │ │ └── src │ │ │ │ ├── roipoint_pool3d.cpp │ │ │ │ └── roipoint_pool3d_kernel.cu │ │ ├── spconv │ │ │ ├── __init__.py │ │ │ ├── conv.py │ │ │ ├── functional.py │ │ │ ├── include │ │ │ │ ├── paramsgrid.h │ │ │ │ ├── prettyprint.h │ │ │ │ ├── pybind11_utils.h │ │ │ │ ├── spconv │ │ │ │ │ ├── fused_spconv_ops.h │ │ │ │ │ ├── geometry.h │ │ │ │ │ ├── indice.cu.h │ │ │ │ │ ├── indice.h │ │ │ │ │ ├── maxpool.h │ │ │ │ │ ├── mp_helper.h │ │ │ │ │ ├── point2voxel.h │ │ │ │ │ ├── pool_ops.h │ │ │ │ │ ├── reordering.cu.h │ │ │ │ │ ├── reordering.h │ │ │ │ │ └── spconv_ops.h │ │ │ │ ├── tensorview │ │ │ │ │ ├── helper_kernel.cu.h │ │ │ │ │ ├── helper_launch.h │ │ │ │ │ └── tensorview.h │ │ │ │ ├── torch_utils.h │ │ │ │ └── utility │ │ │ │ │ └── timer.h │ │ │ ├── modules.py │ │ │ ├── ops.py │ │ │ ├── pool.py │ │ │ ├── src │ │ │ │ ├── all.cc │ │ │ │ ├── indice.cc │ │ │ │ ├── indice_cuda.cu │ │ │ │ ├── maxpool.cc │ │ │ │ ├── maxpool_cuda.cu │ │ │ │ ├── reordering.cc │ │ │ │ └── reordering_cuda.cu │ │ │ ├── structure.py │ │ │ └── test_utils.py │ │ └── voxel │ │ │ ├── __init__.py │ │ │ ├── scatter_points.py │ │ │ ├── src │ │ │ ├── scatter_points_cpu.cpp │ │ │ ├── scatter_points_cuda.cu │ │ │ ├── voxelization.cpp │ │ │ ├── voxelization.h │ │ │ ├── voxelization_cpu.cpp │ │ │ └── voxelization_cuda.cu │ │ │ └── voxelize.py │ └── utils │ │ ├── box_coder_utils.py │ │ ├── box_utils.py │ │ ├── calibration_kitti.py │ │ ├── common_utils.py │ │ ├── frozen_bn.py │ │ ├── loss_utils.py │ │ ├── object3d_kitti.py │ │ └── transform_utils.py │ ├── requirements.txt │ ├── setup.py │ └── tools │ ├── demo.py │ ├── eval_utils │ └── eval_utils.py │ ├── test.py │ ├── train.py │ ├── train_utils │ ├── optimization │ │ ├── __init__.py │ │ ├── fastai_optim.py │ │ └── learning_schedules_fastai.py │ └── train_utils.py │ └── visual_utils │ └── visualize_utils.py └── tools ├── analysis_tools ├── analyze_logs.py └── benchmark.py ├── average_runs.py ├── create_data.py ├── create_data.sh ├── data_converter ├── __init__.py ├── create_gt_database.py ├── indoor_converter.py ├── kitti_converter.py ├── kitti_data_utils.py ├── lyft_converter.py ├── lyft_data_fixer.py ├── nuimage_converter.py ├── nuscenes_converter.py ├── s3dis_data_utils.py ├── scannet_data_utils.py ├── sunrgbd_data_utils.py └── waymo_converter.py ├── dist_test.sh ├── dist_train.sh ├── misc ├── browse_dataset.py ├── fuse_conv_bn.py ├── print_config.py └── visualize_results.py ├── model_converters ├── convert_votenet_checkpoints.py ├── publish_model.py └── regnet2mmdet.py ├── slurm_test.sh ├── slurm_train.sh ├── test.py └── train.py /.dev_scripts/linter.sh: -------------------------------------------------------------------------------- 1 | yapf -r -i mmdet3d/ configs/ tests/ tools/ 2 | isort mmdet3d/ configs/ tests/ tools/ 3 | flake8 . 4 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | We appreciate all contributions to improve MMDetection3D. Please refer to [CONTRIBUTING.md](https://github.com/open-mmlab/mmcv/blob/master/CONTRIBUTING.md) in MMCV for more details about the contributing guideline. 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the feature** 11 | 12 | **Motivation** 13 | A clear and concise description of the motivation of the feature. 14 | Ex1. It is inconvenient when [....]. 15 | Ex2. There is a recent paper [....], which is very helpful for [....]. 16 | 17 | **Related resources** 18 | If there is an official code release or third-party implementations, please also provide the information here, which would be very helpful. 19 | 20 | **Additional context** 21 | Add any other context or screenshots about the feature request here. 22 | If you would like to implement the feature and create a PR, please leave a comment here and that would be much appreciated. 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general_questions.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General questions 3 | about: Ask general questions to get help 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. 2 | 3 | ## Motivation 4 | Please describe the motivation of this PR and the goal you want to achieve through this PR. 5 | 6 | ## Modification 7 | Please briefly describe what modification is made in this PR. 8 | 9 | ## BC-breaking (Optional) 10 | Does the modification introduce changes that break the back-compatibility of the downstream repos? 11 | If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR. 12 | 13 | ## Use cases (Optional) 14 | If this PR introduces a new feature, it is better to list some use cases here, and update the documentation. 15 | 16 | ## Checklist 17 | 18 | 1. Pre-commit or other linting tools are used to fix the potential lint issues. 19 | 2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness. 20 | 3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects. 21 | 4. The documentation has been modified accordingly, like docstring or example tutorials. 22 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: deploy 2 | 3 | on: push 4 | 5 | jobs: 6 | build-n-publish: 7 | runs-on: ubuntu-18.04 8 | if: startsWith(github.event.ref, 'refs/tags') 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Set up Python 3.7 12 | uses: actions/setup-python@v2 13 | with: 14 | python-version: 3.7 15 | - name: Install torch 16 | run: pip install torch 17 | - name: Build MMDet3D 18 | run: python setup.py sdist 19 | - name: Publish distribution to PyPI 20 | run: | 21 | pip install twine 22 | twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }} 23 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://gitlab.com/pycqa/flake8.git 3 | rev: 3.8.3 4 | hooks: 5 | - id: flake8 6 | - repo: https://github.com/asottile/seed-isort-config 7 | rev: v2.2.0 8 | hooks: 9 | - id: seed-isort-config 10 | - repo: https://github.com/timothycrosley/isort 11 | rev: 5.0.2 12 | hooks: 13 | - id: isort 14 | - repo: https://github.com/pre-commit/mirrors-yapf 15 | rev: v0.30.0 16 | hooks: 17 | - id: yapf 18 | - repo: https://github.com/pre-commit/pre-commit-hooks 19 | rev: v3.1.0 20 | hooks: 21 | - id: trailing-whitespace 22 | - id: check-yaml 23 | - id: end-of-file-fixer 24 | - id: requirements-txt-fixer 25 | - id: double-quote-string-fixer 26 | - id: check-merge-conflict 27 | - id: fix-encoding-pragma 28 | args: ["--remove"] 29 | - id: mixed-line-ending 30 | args: ["--fix=lf"] 31 | - repo: https://github.com/myint/docformatter 32 | rev: v1.3.1 33 | hooks: 34 | - id: docformatter 35 | args: ["--in-place", "--wrap-descriptions", "79"] 36 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | python: 4 | version: 3.7 5 | install: 6 | - requirements: requirements/docs.txt 7 | - requirements: requirements/runtime.txt 8 | - requirements: requirements/readthedocs.txt 9 | - requirements: requirements/mminstall.txt 10 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include mmdet3d/model-index.yml 2 | include requirements/*.txt 3 | recursive-include mmdet3d/configs *.py *.yml 4 | recursive-include mmdet3d/tools *.sh *.py 5 | recursive-include mmdet3d/ops *.cpp *.cu *.h *.cc 6 | recursive-include mmdet3d/demo *.png *.jpg *.bin *.pkl *.py 7 | -------------------------------------------------------------------------------- /configs/3dssd/metafile.yml: -------------------------------------------------------------------------------- 1 | Collections: 2 | - Name: 3DSSD 3 | Metadata: 4 | Training Data: KITTI 5 | Training Techniques: 6 | - AdamW 7 | Training Resources: 4x TITAN X 8 | Architecture: 9 | - PointNet++ 10 | Paper: https://arxiv.org/abs/2002.10187 11 | README: configs/3dssd/README.md 12 | 13 | Models: 14 | - Name: 3dssd_4x4_kitti-3d-car 15 | In Collection: 3DSSD 16 | Config: configs/3dssd/3dssd_4x4_kitti-3d-car.py 17 | Metadata: 18 | Training Memory (GB): 4.7 19 | Results: 20 | - Task: 3D Object Detection 21 | Dataset: KITTI 22 | Metrics: 23 | mAP: 78.69 24 | Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/3dssd/3dssd_kitti-3d-car_20210602_124438-b4276f56.pth 25 | -------------------------------------------------------------------------------- /configs/_base_/default_runtime.py: -------------------------------------------------------------------------------- 1 | checkpoint_config = dict(interval=1) 2 | # yapf:disable push 3 | # By default we use textlogger hook and tensorboard 4 | # For more loggers see 5 | # https://mmcv.readthedocs.io/en/latest/api.html#mmcv.runner.LoggerHook 6 | log_config = dict( 7 | interval=50, 8 | hooks=[ 9 | dict(type='TextLoggerHook'), 10 | dict(type='TensorboardLoggerHook') 11 | ]) 12 | # yapf:enable 13 | dist_params = dict(backend='nccl') 14 | log_level = 'INFO' 15 | work_dir = None 16 | load_from = None 17 | resume_from = None 18 | workflow = [('train', 1)] 19 | -------------------------------------------------------------------------------- /configs/_base_/models/hv_pointpillars_fpn_lyft.py: -------------------------------------------------------------------------------- 1 | _base_ = './hv_pointpillars_fpn_nus.py' 2 | 3 | # model settings (based on nuScenes model settings) 4 | # Voxel size for voxel encoder 5 | # Usually voxel size is changed consistently with the point cloud range 6 | # If point cloud range is modified, do remember to change all related 7 | # keys in the config. 8 | model = dict( 9 | pts_voxel_layer=dict( 10 | max_num_points=20, 11 | point_cloud_range=[-80, -80, -5, 80, 80, 3], 12 | max_voxels=(60000, 60000)), 13 | pts_voxel_encoder=dict( 14 | feat_channels=[64], point_cloud_range=[-80, -80, -5, 80, 80, 3]), 15 | pts_middle_encoder=dict(output_shape=[640, 640]), 16 | pts_bbox_head=dict( 17 | num_classes=9, 18 | anchor_generator=dict( 19 | ranges=[[-80, -80, -1.8, 80, 80, -1.8]], custom_values=[]), 20 | bbox_coder=dict(type='DeltaXYZWLHRBBoxCoder', code_size=7)), 21 | # model training settings (based on nuScenes model settings) 22 | train_cfg=dict(pts=dict(code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]))) 23 | -------------------------------------------------------------------------------- /configs/_base_/models/hv_pointpillars_fpn_range100_lyft.py: -------------------------------------------------------------------------------- 1 | _base_ = './hv_pointpillars_fpn_nus.py' 2 | 3 | # model settings (based on nuScenes model settings) 4 | # Voxel size for voxel encoder 5 | # Usually voxel size is changed consistently with the point cloud range 6 | # If point cloud range is modified, do remember to change all related 7 | # keys in the config. 8 | model = dict( 9 | pts_voxel_layer=dict( 10 | max_num_points=20, 11 | point_cloud_range=[-100, -100, -5, 100, 100, 3], 12 | max_voxels=(60000, 60000)), 13 | pts_voxel_encoder=dict( 14 | feat_channels=[64], point_cloud_range=[-100, -100, -5, 100, 100, 3]), 15 | pts_middle_encoder=dict(output_shape=[800, 800]), 16 | pts_bbox_head=dict( 17 | num_classes=9, 18 | anchor_generator=dict( 19 | ranges=[[-100, -100, -1.8, 100, 100, -1.8]], custom_values=[]), 20 | bbox_coder=dict(type='DeltaXYZWLHRBBoxCoder', code_size=7)), 21 | # model training settings (based on nuScenes model settings) 22 | train_cfg=dict(pts=dict(code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]))) 23 | -------------------------------------------------------------------------------- /configs/_base_/models/pointnet2_msg.py: -------------------------------------------------------------------------------- 1 | _base_ = './pointnet2_ssg.py' 2 | 3 | # model settings 4 | model = dict( 5 | backbone=dict( 6 | _delete_=True, 7 | type='PointNet2SAMSG', 8 | in_channels=6, # [xyz, rgb], should be modified with dataset 9 | num_points=(1024, 256, 64, 16), 10 | radii=((0.05, 0.1), (0.1, 0.2), (0.2, 0.4), (0.4, 0.8)), 11 | num_samples=((16, 32), (16, 32), (16, 32), (16, 32)), 12 | sa_channels=(((16, 16, 32), (32, 32, 64)), ((64, 64, 128), (64, 96, 13 | 128)), 14 | ((128, 196, 256), (128, 196, 256)), ((256, 256, 512), 15 | (256, 384, 512))), 16 | aggregation_channels=(None, None, None, None), 17 | fps_mods=(('D-FPS'), ('D-FPS'), ('D-FPS'), ('D-FPS')), 18 | fps_sample_range_lists=((-1), (-1), (-1), (-1)), 19 | dilated_group=(False, False, False, False), 20 | out_indices=(0, 1, 2, 3), 21 | sa_cfg=dict( 22 | type='PointSAModuleMSG', 23 | pool_mod='max', 24 | use_xyz=True, 25 | normalize_xyz=False)), 26 | decode_head=dict( 27 | fp_channels=((1536, 256, 256), (512, 256, 256), (352, 256, 128), 28 | (128, 128, 128, 128)))) 29 | -------------------------------------------------------------------------------- /configs/_base_/models/pointnet2_ssg.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | model = dict( 3 | type='EncoderDecoder3D', 4 | backbone=dict( 5 | type='PointNet2SASSG', 6 | in_channels=6, # [xyz, rgb], should be modified with dataset 7 | num_points=(1024, 256, 64, 16), 8 | radius=(0.1, 0.2, 0.4, 0.8), 9 | num_samples=(32, 32, 32, 32), 10 | sa_channels=((32, 32, 64), (64, 64, 128), (128, 128, 256), (256, 256, 11 | 512)), 12 | fp_channels=(), 13 | norm_cfg=dict(type='BN2d'), 14 | sa_cfg=dict( 15 | type='PointSAModule', 16 | pool_mod='max', 17 | use_xyz=True, 18 | normalize_xyz=False)), 19 | decode_head=dict( 20 | type='PointNet2Head', 21 | fp_channels=((768, 256, 256), (384, 256, 256), (320, 256, 128), 22 | (128, 128, 128, 128)), 23 | channels=128, 24 | dropout_ratio=0.5, 25 | conv_cfg=dict(type='Conv1d'), 26 | norm_cfg=dict(type='BN1d'), 27 | act_cfg=dict(type='ReLU'), 28 | loss_decode=dict( 29 | type='CrossEntropyLoss', 30 | use_sigmoid=False, 31 | class_weight=None, # should be modified with dataset 32 | loss_weight=1.0)), 33 | # model training and testing settings 34 | train_cfg=dict(), 35 | test_cfg=dict(mode='slide')) 36 | -------------------------------------------------------------------------------- /configs/_base_/schedules/cosine.py: -------------------------------------------------------------------------------- 1 | # This schedule is mainly used by models with dynamic voxelization 2 | # optimizer 3 | lr = 0.003 # max learning rate 4 | optimizer = dict( 5 | type='AdamW', 6 | lr=lr, 7 | betas=(0.95, 0.99), # the momentum is change during training 8 | weight_decay=0.001) 9 | optimizer_config = dict(grad_clip=dict(max_norm=10, norm_type=2)) 10 | 11 | lr_config = dict( 12 | policy='CosineAnnealing', 13 | warmup='linear', 14 | warmup_iters=1000, 15 | warmup_ratio=1.0 / 10, 16 | min_lr_ratio=1e-5) 17 | 18 | momentum_config = None 19 | 20 | runner = dict(type='EpochBasedRunner', max_epochs=40) 21 | -------------------------------------------------------------------------------- /configs/_base_/schedules/cyclic_20e.py: -------------------------------------------------------------------------------- 1 | # For nuScenes dataset, we usually evaluate the model at the end of training. 2 | # Since the models are trained by 24 epochs by default, we set evaluation 3 | # interval to be 20. Please change the interval accordingly if you do not 4 | # use a default schedule. 5 | # optimizer 6 | # This schedule is mainly used by models on nuScenes dataset 7 | optimizer = dict(type='AdamW', lr=1e-4, weight_decay=0.01) 8 | # max_norm=10 is better for SECOND 9 | optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2)) 10 | lr_config = dict( 11 | policy='cyclic', 12 | target_ratio=(10, 1e-4), 13 | cyclic_times=1, 14 | step_ratio_up=0.4, 15 | ) 16 | momentum_config = dict( 17 | policy='cyclic', 18 | target_ratio=(0.85 / 0.95, 1), 19 | cyclic_times=1, 20 | step_ratio_up=0.4, 21 | ) 22 | 23 | # runtime settings 24 | runner = dict(type='EpochBasedRunner', max_epochs=20) 25 | -------------------------------------------------------------------------------- /configs/_base_/schedules/mmdet_schedule_1x.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) 3 | optimizer_config = dict(grad_clip=None) 4 | # learning policy 5 | lr_config = dict( 6 | policy='step', 7 | warmup='linear', 8 | warmup_iters=500, 9 | warmup_ratio=0.001, 10 | step=[8, 11]) 11 | runner = dict(type='EpochBasedRunner', max_epochs=12) 12 | -------------------------------------------------------------------------------- /configs/_base_/schedules/schedule_2x.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | # This schedule is mainly used by models on nuScenes dataset 3 | optimizer = dict(type='AdamW', lr=0.001, weight_decay=0.01) 4 | # max_norm=10 is better for SECOND 5 | optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2)) 6 | lr_config = dict( 7 | policy='step', 8 | warmup='linear', 9 | warmup_iters=1000, 10 | warmup_ratio=1.0 / 1000, 11 | step=[20, 23]) 12 | momentum_config = None 13 | # runtime settings 14 | runner = dict(type='EpochBasedRunner', max_epochs=24) 15 | -------------------------------------------------------------------------------- /configs/_base_/schedules/schedule_3x.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | # This schedule is mainly used by models on indoor dataset, 3 | # e.g., VoteNet on SUNRGBD and ScanNet 4 | lr = 0.008 # max learning rate 5 | optimizer = dict(type='AdamW', lr=lr, weight_decay=0.01) 6 | optimizer_config = dict(grad_clip=dict(max_norm=10, norm_type=2)) 7 | lr_config = dict(policy='step', warmup=None, step=[24, 32]) 8 | # runtime settings 9 | runner = dict(type='EpochBasedRunner', max_epochs=36) 10 | -------------------------------------------------------------------------------- /configs/_base_/schedules/seg_cosine_200e.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | # This schedule is mainly used on ScanNet dataset in segmentation task 3 | optimizer = dict(type='Adam', lr=0.001, weight_decay=0.01) 4 | optimizer_config = dict(grad_clip=None) 5 | lr_config = dict(policy='CosineAnnealing', warmup=None, min_lr=1e-5) 6 | momentum_config = None 7 | 8 | # runtime settings 9 | runner = dict(type='EpochBasedRunner', max_epochs=200) 10 | -------------------------------------------------------------------------------- /configs/_base_/schedules/seg_cosine_50e.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | # This schedule is mainly used on S3DIS dataset in segmentation task 3 | optimizer = dict(type='Adam', lr=0.001, weight_decay=0.001) 4 | optimizer_config = dict(grad_clip=None) 5 | lr_config = dict(policy='CosineAnnealing', warmup=None, min_lr=1e-5) 6 | momentum_config = None 7 | 8 | # runtime settings 9 | runner = dict(type='EpochBasedRunner', max_epochs=50) 10 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_0075voxel_second_secfpn_circlenms_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_0075voxel_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict(test_cfg=dict(pts=dict(nms_type='circle'))) 4 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_0075voxel_second_secfpn_dcn_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_0075voxel_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict( 4 | pts_bbox_head=dict( 5 | separate_head=dict( 6 | type='DCNSeparateHead', 7 | dcn_config=dict( 8 | type='DCN', 9 | in_channels=64, 10 | out_channels=64, 11 | kernel_size=3, 12 | padding=1, 13 | groups=4), 14 | init_bias=-2.19, 15 | final_kernel=3))) 16 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_0075voxel_second_secfpn_dcn_circlenms_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_0075voxel_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict( 4 | pts_bbox_head=dict( 5 | separate_head=dict( 6 | type='DCNSeparateHead', 7 | dcn_config=dict( 8 | type='DCN', 9 | in_channels=64, 10 | out_channels=64, 11 | kernel_size=3, 12 | padding=1, 13 | groups=4), 14 | init_bias=-2.19, 15 | final_kernel=3)), 16 | test_cfg=dict(pts=dict(nms_type='circle'))) 17 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_01voxel_second_secfpn_circlenms_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_01voxel_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict(test_cfg=dict(pts=dict(nms_type='circle'))) 4 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_01voxel_second_secfpn_dcn_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_01voxel_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict( 4 | pts_bbox_head=dict( 5 | separate_head=dict( 6 | type='DCNSeparateHead', 7 | dcn_config=dict( 8 | type='DCN', 9 | in_channels=64, 10 | out_channels=64, 11 | kernel_size=3, 12 | padding=1, 13 | groups=4), 14 | init_bias=-2.19, 15 | final_kernel=3))) 16 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_01voxel_second_secfpn_dcn_circlenms_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_01voxel_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict( 4 | pts_bbox_head=dict( 5 | separate_head=dict( 6 | type='DCNSeparateHead', 7 | dcn_config=dict( 8 | type='DCN', 9 | in_channels=64, 10 | out_channels=64, 11 | kernel_size=3, 12 | padding=1, 13 | groups=4), 14 | init_bias=-2.19, 15 | final_kernel=3)), 16 | test_cfg=dict(pts=dict(nms_type='circle'))) 17 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_02pillar_second_secfpn_circlenms_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_02pillar_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict(test_cfg=dict(pts=dict(nms_type='circle'))) 4 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_02pillar_second_secfpn_dcn_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_02pillar_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict( 4 | pts_bbox_head=dict( 5 | separate_head=dict( 6 | type='DCNSeparateHead', 7 | dcn_config=dict( 8 | type='DCN', 9 | in_channels=64, 10 | out_channels=64, 11 | kernel_size=3, 12 | padding=1, 13 | groups=4), 14 | init_bias=-2.19, 15 | final_kernel=3))) 16 | -------------------------------------------------------------------------------- /configs/centerpoint/centerpoint_02pillar_second_secfpn_dcn_circlenms_4x8_cyclic_20e_nus.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./centerpoint_02pillar_second_secfpn_4x8_cyclic_20e_nus.py'] 2 | 3 | model = dict( 4 | pts_bbox_head=dict( 5 | separate_head=dict( 6 | type='DCNSeparateHead', 7 | dcn_config=dict( 8 | type='DCN', 9 | in_channels=64, 10 | out_channels=64, 11 | kernel_size=3, 12 | padding=1, 13 | groups=4), 14 | init_bias=-2.19, 15 | final_kernel=3)), 16 | test_cfg=dict(pts=dict(nms_type='circle'))) 17 | -------------------------------------------------------------------------------- /configs/dynamic_voxelization/dv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py: -------------------------------------------------------------------------------- 1 | _base_ = '../pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py' 2 | 3 | voxel_size = [0.16, 0.16, 4] 4 | point_cloud_range = [0, -39.68, -3, 69.12, 39.68, 1] 5 | 6 | model = dict( 7 | type='DynamicVoxelNet', 8 | voxel_layer=dict( 9 | max_num_points=-1, 10 | point_cloud_range=point_cloud_range, 11 | voxel_size=voxel_size, 12 | max_voxels=(-1, -1)), 13 | voxel_encoder=dict( 14 | type='DynamicPillarFeatureNet', 15 | in_channels=4, 16 | feat_channels=[64], 17 | with_distance=False, 18 | voxel_size=voxel_size, 19 | point_cloud_range=point_cloud_range)) 20 | -------------------------------------------------------------------------------- /configs/dynamic_voxelization/dv_second_secfpn_2x8_cosine_80e_kitti-3d-3class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_second_secfpn_kitti.py', 3 | '../_base_/datasets/kitti-3d-3class.py', '../_base_/schedules/cosine.py', 4 | '../_base_/default_runtime.py' 5 | ] 6 | 7 | point_cloud_range = [0, -40, -3, 70.4, 40, 1] 8 | voxel_size = [0.05, 0.05, 0.1] 9 | 10 | model = dict( 11 | type='DynamicVoxelNet', 12 | voxel_layer=dict( 13 | _delete_=True, 14 | max_num_points=-1, 15 | point_cloud_range=point_cloud_range, 16 | voxel_size=voxel_size, 17 | max_voxels=(-1, -1)), 18 | voxel_encoder=dict( 19 | _delete_=True, 20 | type='DynamicSimpleVFE', 21 | voxel_size=voxel_size, 22 | point_cloud_range=point_cloud_range)) 23 | -------------------------------------------------------------------------------- /configs/dynamic_voxelization/dv_second_secfpn_6x8_80e_kitti-3d-car.py: -------------------------------------------------------------------------------- 1 | _base_ = '../second/hv_second_secfpn_6x8_80e_kitti-3d-car.py' 2 | 3 | point_cloud_range = [0, -40, -3, 70.4, 40, 1] 4 | voxel_size = [0.05, 0.05, 0.1] 5 | 6 | model = dict( 7 | type='DynamicVoxelNet', 8 | voxel_layer=dict( 9 | _delete_=True, 10 | max_num_points=-1, 11 | point_cloud_range=point_cloud_range, 12 | voxel_size=voxel_size, 13 | max_voxels=(-1, -1)), 14 | voxel_encoder=dict( 15 | _delete_=True, 16 | type='DynamicSimpleVFE', 17 | voxel_size=voxel_size, 18 | point_cloud_range=point_cloud_range)) 19 | -------------------------------------------------------------------------------- /configs/fcos3d/fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d_finetune.py: -------------------------------------------------------------------------------- 1 | _base_ = './fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d.py' 2 | # model settings 3 | model = dict( 4 | train_cfg=dict( 5 | code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.05, 0.05])) 6 | # optimizer 7 | optimizer = dict(lr=0.001) 8 | load_from = 'work_dirs/fcos3d_nus/latest.pth' 9 | -------------------------------------------------------------------------------- /configs/fp16/hv_pointpillars_fpn_sbn-all_fp16_2x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = '../pointpillars/hv_pointpillars_fpn_sbn-all_4x8_2x_nus-3d.py' 2 | data = dict(samples_per_gpu=2, workers_per_gpu=2) 3 | # fp16 settings, the loss scale is specifically tuned to avoid Nan 4 | fp16 = dict(loss_scale=32.) 5 | -------------------------------------------------------------------------------- /configs/fp16/hv_pointpillars_regnet-400mf_fpn_sbn-all_fp16_2x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = '../regnet/hv_pointpillars_regnet-400mf_fpn_sbn-all_4x8_2x_nus-3d.py' 2 | data = dict(samples_per_gpu=2, workers_per_gpu=2) 3 | # fp16 settings, the loss scale is specifically tuned to avoid Nan 4 | fp16 = dict(loss_scale=32.) 5 | -------------------------------------------------------------------------------- /configs/fp16/hv_pointpillars_secfpn_sbn-all_fp16_2x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = '../pointpillars/hv_pointpillars_secfpn_sbn-all_4x8_2x_nus-3d.py' 2 | data = dict(samples_per_gpu=2, workers_per_gpu=2) 3 | # fp16 settings, the loss scale is specifically tuned to avoid Nan 4 | fp16 = dict(loss_scale=32.) 5 | -------------------------------------------------------------------------------- /configs/fp16/hv_second_secfpn_fp16_6x8_80e_kitti-3d-3class.py: -------------------------------------------------------------------------------- 1 | _base_ = '../second/hv_second_secfpn_6x8_80e_kitti-3d-3class.py' 2 | # fp16 settings 3 | fp16 = dict(loss_scale=512.) 4 | -------------------------------------------------------------------------------- /configs/fp16/hv_second_secfpn_fp16_6x8_80e_kitti-3d-car.py: -------------------------------------------------------------------------------- 1 | _base_ = '../second/hv_second_secfpn_6x8_80e_kitti-3d-car.py' 2 | # fp16 settings 3 | fp16 = dict(loss_scale=512.) 4 | -------------------------------------------------------------------------------- /configs/free_anchor/hv_pointpillars_regnet-1.6gf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' 2 | 3 | model = dict( 4 | pretrained=dict(pts='open-mmlab://regnetx_1.6gf'), 5 | pts_backbone=dict( 6 | _delete_=True, 7 | type='NoStemRegNet', 8 | arch='regnetx_1.6gf', 9 | out_indices=(1, 2, 3), 10 | frozen_stages=-1, 11 | strides=(1, 2, 2, 2), 12 | base_channels=64, 13 | stem_channels=64, 14 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 15 | norm_eval=False, 16 | style='pytorch'), 17 | pts_neck=dict(in_channels=[168, 408, 912])) 18 | -------------------------------------------------------------------------------- /configs/free_anchor/hv_pointpillars_regnet-3.2gf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' 2 | 3 | model = dict( 4 | pretrained=dict(pts='open-mmlab://regnetx_3.2gf'), 5 | pts_backbone=dict( 6 | _delete_=True, 7 | type='NoStemRegNet', 8 | arch='regnetx_3.2gf', 9 | out_indices=(1, 2, 3), 10 | frozen_stages=-1, 11 | strides=(1, 2, 2, 2), 12 | base_channels=64, 13 | stem_channels=64, 14 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 15 | norm_eval=False, 16 | style='pytorch'), 17 | pts_neck=dict(in_channels=[192, 432, 1008])) 18 | -------------------------------------------------------------------------------- /configs/free_anchor/hv_pointpillars_regnet-400mf_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' 2 | 3 | model = dict( 4 | pretrained=dict(pts='open-mmlab://regnetx_400mf'), 5 | pts_backbone=dict( 6 | _delete_=True, 7 | type='NoStemRegNet', 8 | arch='regnetx_400mf', 9 | out_indices=(1, 2, 3), 10 | frozen_stages=-1, 11 | strides=(1, 2, 2, 2), 12 | base_channels=64, 13 | stem_channels=64, 14 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 15 | norm_eval=False, 16 | style='pytorch'), 17 | pts_neck=dict(in_channels=[64, 160, 384])) 18 | -------------------------------------------------------------------------------- /configs/h3dnet/README.md: -------------------------------------------------------------------------------- 1 | # H3DNet: 3D Object Detection Using Hybrid Geometric Primitives 2 | 3 | ## Introduction 4 | 5 | 6 | 7 | We implement H3DNet and provide the result and checkpoints on ScanNet datasets. 8 | 9 | ``` 10 | @inproceedings{zhang2020h3dnet, 11 | author = {Zhang, Zaiwei and Sun, Bo and Yang, Haitao and Huang, Qixing}, 12 | title = {H3DNet: 3D Object Detection Using Hybrid Geometric Primitives}, 13 | booktitle = {Proceedings of the European Conference on Computer Vision}, 14 | year = {2020} 15 | } 16 | ``` 17 | 18 | ## Results 19 | 20 | ### ScanNet 21 | 22 | | Backbone | Lr schd | Mem (GB) | Inf time (fps) | AP@0.25 |AP@0.5| Download | 23 | | :---------: | :-----: | :------: | :------------: | :----: |:----: | :------: | 24 | | [MultiBackbone](./h3dnet_3x8_scannet-3d-18class.py) | 3x |7.9||66.43|48.01|[model](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/h3dnet/h3dnet_scannet-3d-18class/h3dnet_scannet-3d-18class_20200830_000136-02e36246.pth) | [log](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/h3dnet/h3dnet_scannet-3d-18class/h3dnet_scannet-3d-18class_20200830_000136.log.json) | 25 | -------------------------------------------------------------------------------- /configs/h3dnet/metafile.yml: -------------------------------------------------------------------------------- 1 | Collections: 2 | - Name: H3DNet 3 | Metadata: 4 | Training Data: ScanNet 5 | Training Techniques: 6 | - AdamW 7 | Training Resources: 8x GeForce GTX 1080 Ti 8 | Architecture: 9 | Paper: https://arxiv.org/abs/2006.05682 10 | README: configs/h3dnet/README.md 11 | 12 | Models: 13 | - Name: h3dnet_3x8_scannet-3d-18class 14 | In Collection: H3DNet 15 | Config: configs/h3dnet/h3dnet_3x8_scannet-3d-18class.py 16 | Metadata: 17 | Training Memory (GB): 7.9 18 | Results: 19 | - Task: 3D Object Detection 20 | Dataset: ScanNet 21 | Metrics: 22 | AP@0.25: 66.43 23 | AP@0.5: 48.01 24 | Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/h3dnet/h3dnet_scannet-3d-18class/h3dnet_scannet-3d-18class_20200830_000136-02e36246.pth 25 | -------------------------------------------------------------------------------- /configs/imvoxelnet/README.md: -------------------------------------------------------------------------------- 1 | # ImVoxelNet: Image to Voxels Projection for Monocular and Multi-View General-Purpose 3D Object Detection 2 | 3 | ## Introduction 4 | 5 | 6 | 7 | We implement a monocular 3D detector ImVoxelNet and provide its results and checkpoints on KITTI dataset. 8 | Results for SUN RGB-D, ScanNet and nuScenes are currently available in ImVoxelNet authors 9 | [repo](https://github.com/saic-vul/imvoxelnet) (based on mmdetection3d). 10 | 11 | ``` 12 | @article{rukhovich2021imvoxelnet, 13 | title={ImVoxelNet: Image to Voxels Projection for Monocular and Multi-View General-Purpose 3D Object Detection}, 14 | author={Danila Rukhovich, Anna Vorontsova, Anton Konushin}, 15 | journal={arXiv preprint arXiv:2106.01178}, 16 | year={2021} 17 | } 18 | ``` 19 | 20 | ## Results 21 | 22 | ### KITTI 23 | 24 | | Backbone |Class| Lr schd | Mem (GB) | Inf time (fps) | mAP | Download | 25 | | :---------: | :-----: |:-----: | :------: | :------------: | :----: |:----: | 26 | | [ResNet-50](./imvoxelnet_kitti-3d-car.py) | Car | 3x | | |17.4|[model](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/imvoxelnet/imvoxelnet_kitti-3d-car_20210610_152323-b9abba85.pth) | [log](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/imvoxelnet/imvoxelnet_kitti-3d-car_20210610_152323.log.json)| 27 | -------------------------------------------------------------------------------- /configs/imvoxelnet/metafile.yml: -------------------------------------------------------------------------------- 1 | Collections: 2 | - Name: ImVoxelNet 3 | Metadata: 4 | Training Data: KITTI 5 | Training Techniques: 6 | - AdamW 7 | Training Resources: 8x Tesla P40 8 | Architecture: 9 | - Anchor3DHead 10 | Paper: https://arxiv.org/abs/2106.01178 11 | README: configs/imvoxelnet/README.md 12 | 13 | Models: 14 | - Name: imvoxelnet_kitti-3d-car 15 | In Collection: ImVoxelNet 16 | Config: configs/imvoxelnet/imvoxelnet_kitti-3d-car.py 17 | Metadata: 18 | Training Memory (GB): 15.0 19 | Results: 20 | - Task: 3D Object Detection 21 | Dataset: KITTI 22 | Metrics: 23 | mAP: 17.4 24 | Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/imvoxelnet/imvoxelnet_kitti-3d-car_20210610_152323-b9abba85.pth 25 | -------------------------------------------------------------------------------- /configs/mvxnet/README.md: -------------------------------------------------------------------------------- 1 | # MVX-Net: Multimodal VoxelNet for 3D Object Detection 2 | 3 | ## Introduction 4 | 5 | 6 | 7 | We implement MVX-Net and provide its results and models on KITTI dataset. 8 | 9 | ``` 10 | @inproceedings{sindagi2019mvx, 11 | title={MVX-Net: Multimodal voxelnet for 3D object detection}, 12 | author={Sindagi, Vishwanath A and Zhou, Yin and Tuzel, Oncel}, 13 | booktitle={2019 International Conference on Robotics and Automation (ICRA)}, 14 | pages={7276--7282}, 15 | year={2019}, 16 | organization={IEEE} 17 | } 18 | 19 | ``` 20 | 21 | ## Results 22 | 23 | ### KITTI 24 | 25 | | Backbone |Class| Lr schd | Mem (GB) | Inf time (fps) | mAP | Download | 26 | | :---------: | :-----: | :------: | :------------: | :----: |:----: | :------: | 27 | | [SECFPN](./dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class.py)|3 Class|cosine 80e|6.7||63.0|[model](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/mvxnet/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class_20200621_003904-10140f2d.pth) | [log](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/mvxnet/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class_20200621_003904.log.json)| 28 | -------------------------------------------------------------------------------- /configs/mvxnet/metafile.yml: -------------------------------------------------------------------------------- 1 | Collections: 2 | - Name: MVX-Net 3 | Metadata: 4 | Training Data: KITTI 5 | Training Techniques: 6 | - AdamW 7 | Training Resources: 8x V100 GPUs 8 | Architecture: 9 | - Feature Pyramid Network 10 | - Dynamic Voxelization 11 | Paper: https://arxiv.org/abs/1904.01649 12 | README: configs/mvxnet/README.md 13 | 14 | Models: 15 | - Name: dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class 16 | In Collection: MVX-Net 17 | Config: configs/mvxnet/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class.py 18 | Metadata: 19 | Training Memory (GB): 6.7 20 | Results: 21 | - Task: 3D Object Detection 22 | Dataset: KITTI 23 | Metrics: 24 | mAP: 63.0 25 | Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/mvxnet/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class_20200621_003904-10140f2d.pth 26 | -------------------------------------------------------------------------------- /configs/nuimages/cascade_mask_rcnn_r101_fpn_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade_mask_rcnn_r50_fpn_1x_nuim.py' 2 | model = dict(pretrained='torchvision://resnet101', backbone=dict(depth=101)) 3 | -------------------------------------------------------------------------------- /configs/nuimages/cascade_mask_rcnn_r50_fpn_coco-20e_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade_mask_rcnn_r50_fpn_1x_nuim.py' 2 | 3 | load_from = 'http://download.openmmlab.com/mmdetection/v2.0/cascade_rcnn/cascade_mask_rcnn_r50_fpn_20e_coco/cascade_mask_rcnn_r50_fpn_20e_coco_bbox_mAP-0.419__segm_mAP-0.365_20200504_174711-4af8e66e.pth' # noqa 4 | -------------------------------------------------------------------------------- /configs/nuimages/cascade_mask_rcnn_r50_fpn_coco-20e_20e_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade_mask_rcnn_r50_fpn_1x_nuim.py' 2 | 3 | # learning policy 4 | lr_config = dict(step=[16, 19]) 5 | runner = dict(max_epochs=20) 6 | 7 | load_from = 'http://download.openmmlab.com/mmdetection/v2.0/cascade_rcnn/cascade_mask_rcnn_r50_fpn_20e_coco/cascade_mask_rcnn_r50_fpn_20e_coco_bbox_mAP-0.419__segm_mAP-0.365_20200504_174711-4af8e66e.pth' # noqa 8 | -------------------------------------------------------------------------------- /configs/nuimages/cascade_mask_rcnn_x101_32x4d_fpn_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './cascade_mask_rcnn_r50_fpn_1x_nuim.py' 2 | model = dict( 3 | pretrained='open-mmlab://resnext101_32x4d', 4 | backbone=dict( 5 | type='ResNeXt', 6 | depth=101, 7 | groups=32, 8 | base_width=4, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | frozen_stages=1, 12 | norm_cfg=dict(type='BN', requires_grad=True), 13 | style='pytorch')) 14 | -------------------------------------------------------------------------------- /configs/nuimages/htc_r50_fpn_coco-20e_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_r50_fpn_1x_nuim.py' 2 | 3 | load_from = 'http://download.openmmlab.com/mmdetection/v2.0/htc/htc_r50_fpn_20e_coco/htc_r50_fpn_20e_coco_20200319-fe28c577.pth' # noqa 4 | -------------------------------------------------------------------------------- /configs/nuimages/htc_r50_fpn_coco-20e_20e_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_r50_fpn_coco-20e_1x_nuim.py' 2 | # learning policy 3 | lr_config = dict(step=[16, 19]) 4 | runner = dict(max_epochs=20) 5 | -------------------------------------------------------------------------------- /configs/nuimages/htc_x101_64x4d_fpn_dconv_c3-c5_coco-20e_16x1_20e_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './htc_r50_fpn_1x_nuim.py' 2 | model = dict( 3 | pretrained='open-mmlab://resnext101_64x4d', 4 | backbone=dict( 5 | type='ResNeXt', 6 | depth=101, 7 | groups=64, 8 | base_width=4, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | frozen_stages=1, 12 | norm_cfg=dict(type='BN', requires_grad=True), 13 | norm_eval=True, 14 | style='pytorch', 15 | dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False), 16 | stage_with_dcn=(False, True, True, True))) 17 | 18 | data = dict(samples_per_gpu=1, workers_per_gpu=1) 19 | # learning policy 20 | lr_config = dict(step=[16, 19]) 21 | runner = dict(max_epochs=20) 22 | 23 | load_from = 'http://download.openmmlab.com/mmdetection/v2.0/htc/htc_x101_64x4d_fpn_dconv_c3-c5_mstrain_400_1400_16x1_20e_coco/htc_x101_64x4d_fpn_dconv_c3-c5_mstrain_400_1400_16x1_20e_coco_20200312-946fd751.pth' # noqa 24 | -------------------------------------------------------------------------------- /configs/nuimages/mask_rcnn_r101_fpn_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask_rcnn_r50_fpn_1x_nuim.py' 2 | model = dict(pretrained='torchvision://resnet101', backbone=dict(depth=101)) 3 | -------------------------------------------------------------------------------- /configs/nuimages/mask_rcnn_r50_fpn_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask_rcnn_r50_fpn.py', 3 | '../_base_/datasets/nuim_instance.py', 4 | '../_base_/schedules/mmdet_schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | model = dict( 7 | roi_head=dict( 8 | bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) 9 | -------------------------------------------------------------------------------- /configs/nuimages/mask_rcnn_r50_fpn_coco-2x_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/mask_rcnn_r50_fpn.py', 3 | '../_base_/datasets/nuim_instance.py', 4 | '../_base_/schedules/mmdet_schedule_1x.py', '../_base_/default_runtime.py' 5 | ] 6 | model = dict( 7 | roi_head=dict( 8 | bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) 9 | load_from = 'https://download.openmmlab.com/mmdetection/v2.0/mask_rcnn/mask_rcnn_r50_fpn_2x_coco/mask_rcnn_r50_fpn_2x_coco_bbox_mAP-0.392__segm_mAP-0.354_20200505_003907-3e542a40.pth' # noqa 10 | -------------------------------------------------------------------------------- /configs/nuimages/mask_rcnn_x101_32x4d_fpn_1x_nuim.py: -------------------------------------------------------------------------------- 1 | _base_ = './mask_rcnn_r50_fpn_1x_nuim.py' 2 | model = dict( 3 | pretrained='open-mmlab://resnext101_32x4d', 4 | backbone=dict( 5 | type='ResNeXt', 6 | depth=101, 7 | groups=32, 8 | base_width=4, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | frozen_stages=1, 12 | norm_cfg=dict(type='BN', requires_grad=True), 13 | style='pytorch')) 14 | -------------------------------------------------------------------------------- /configs/parta2/metafile.yml: -------------------------------------------------------------------------------- 1 | Collections: 2 | - Name: Part-A^2 3 | Metadata: 4 | Training Data: KITTI 5 | Training Techniques: 6 | - AdamW 7 | Training Resources: 8x V100 GPUs 8 | Architecture: 9 | - Sparse U-Net 10 | Paper: https://arxiv.org/abs/1907.03670 11 | README: configs/parta2/README.md 12 | 13 | Models: 14 | - Name: hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-3class 15 | In Collection: Part-A^2 16 | Config: configs/parta2/hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-3class.py 17 | Metadata: 18 | Training Memory (GB): 4.1 19 | Results: 20 | - Task: 3D Object Detection 21 | Dataset: KITTI 22 | Metrics: 23 | mAP: 67.9 24 | Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/parta2/hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-3class/hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-3class_20200620_230724-a2672098.pth 25 | 26 | - Name: hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-car 27 | In Collection: Part-A^2 28 | Config: configs/parta2/hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-car.py 29 | Metadata: 30 | Training Memory (GB): 4.0 31 | Results: 32 | - Task: 3D Object Detection 33 | Dataset: KITTI 34 | Metrics: 35 | mAP: 79.16 36 | Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/parta2/hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-car/hv_PartA2_secfpn_2x8_cyclic_80e_kitti-3d-car_20200620_230755-f2a38b9a.pth 37 | -------------------------------------------------------------------------------- /configs/pointnet2/pointnet2_msg_16x2_cosine_250e_scannet_seg-3d-20class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/datasets/scannet_seg-3d-20class.py', 3 | '../_base_/models/pointnet2_msg.py', 4 | '../_base_/schedules/seg_cosine_200e.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | # data settings 8 | data = dict(samples_per_gpu=16) 9 | evaluation = dict(interval=5) 10 | 11 | # model settings 12 | model = dict( 13 | decode_head=dict( 14 | num_classes=20, 15 | ignore_index=20, 16 | # `class_weight` is generated in data pre-processing, saved in 17 | # `data/scannet/seg_info/train_label_weight.npy` 18 | # you can copy paste the values here, or input the file path as 19 | # `class_weight=data/scannet/seg_info/train_label_weight.npy` 20 | loss_decode=dict(class_weight=[ 21 | 2.389689, 2.7215734, 4.5944676, 4.8543367, 4.096086, 4.907941, 22 | 4.690836, 4.512031, 4.623311, 4.9242644, 5.358117, 5.360071, 23 | 5.019636, 4.967126, 5.3502126, 5.4023647, 5.4027233, 5.4169416, 24 | 5.3954206, 4.6971426 25 | ])), 26 | test_cfg=dict( 27 | num_points=8192, 28 | block_size=1.5, 29 | sample_rate=0.5, 30 | use_normalized_coord=False, 31 | batch_size=24)) 32 | 33 | # runtime settings 34 | checkpoint_config = dict(interval=5) 35 | # PointNet2-MSG needs longer training time than PointNet2-SSG 36 | runner = dict(type='EpochBasedRunner', max_epochs=250) 37 | -------------------------------------------------------------------------------- /configs/pointnet2/pointnet2_msg_16x2_cosine_80e_s3dis_seg-3d-13class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/datasets/s3dis_seg-3d-13class.py', 3 | '../_base_/models/pointnet2_msg.py', 4 | '../_base_/schedules/seg_cosine_50e.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | # data settings 8 | data = dict(samples_per_gpu=16) 9 | evaluation = dict(interval=2) 10 | 11 | # model settings 12 | model = dict( 13 | backbone=dict(in_channels=9), # [xyz, rgb, normalized_xyz] 14 | decode_head=dict( 15 | num_classes=13, ignore_index=13, 16 | loss_decode=dict(class_weight=None)), # S3DIS doesn't use class_weight 17 | test_cfg=dict( 18 | num_points=4096, 19 | block_size=1.0, 20 | sample_rate=0.5, 21 | use_normalized_coord=True, 22 | batch_size=24)) 23 | 24 | # runtime settings 25 | checkpoint_config = dict(interval=2) 26 | # PointNet2-MSG needs longer training time than PointNet2-SSG 27 | runner = dict(type='EpochBasedRunner', max_epochs=80) 28 | -------------------------------------------------------------------------------- /configs/pointnet2/pointnet2_ssg_16x2_cosine_200e_scannet_seg-3d-20class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/datasets/scannet_seg-3d-20class.py', 3 | '../_base_/models/pointnet2_ssg.py', 4 | '../_base_/schedules/seg_cosine_200e.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | # data settings 8 | data = dict(samples_per_gpu=16) 9 | evaluation = dict(interval=5) 10 | 11 | # model settings 12 | model = dict( 13 | decode_head=dict( 14 | num_classes=20, 15 | ignore_index=20, 16 | # `class_weight` is generated in data pre-processing, saved in 17 | # `data/scannet/seg_info/train_label_weight.npy` 18 | # you can copy paste the values here, or input the file path as 19 | # `class_weight=data/scannet/seg_info/train_label_weight.npy` 20 | loss_decode=dict(class_weight=[ 21 | 2.389689, 2.7215734, 4.5944676, 4.8543367, 4.096086, 4.907941, 22 | 4.690836, 4.512031, 4.623311, 4.9242644, 5.358117, 5.360071, 23 | 5.019636, 4.967126, 5.3502126, 5.4023647, 5.4027233, 5.4169416, 24 | 5.3954206, 4.6971426 25 | ])), 26 | test_cfg=dict( 27 | num_points=8192, 28 | block_size=1.5, 29 | sample_rate=0.5, 30 | use_normalized_coord=False, 31 | batch_size=24)) 32 | 33 | # runtime settings 34 | checkpoint_config = dict(interval=5) 35 | -------------------------------------------------------------------------------- /configs/pointnet2/pointnet2_ssg_16x2_cosine_50e_s3dis_seg-3d-13class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/datasets/s3dis_seg-3d-13class.py', 3 | '../_base_/models/pointnet2_ssg.py', 4 | '../_base_/schedules/seg_cosine_50e.py', '../_base_/default_runtime.py' 5 | ] 6 | 7 | # data settings 8 | data = dict(samples_per_gpu=16) 9 | evaluation = dict(interval=2) 10 | 11 | # model settings 12 | model = dict( 13 | backbone=dict(in_channels=9), # [xyz, rgb, normalized_xyz] 14 | decode_head=dict( 15 | num_classes=13, ignore_index=13, 16 | loss_decode=dict(class_weight=None)), # S3DIS doesn't use class_weight 17 | test_cfg=dict( 18 | num_points=4096, 19 | block_size=1.0, 20 | sample_rate=0.5, 21 | use_normalized_coord=True, 22 | batch_size=24)) 23 | 24 | # runtime settings 25 | checkpoint_config = dict(interval=2) 26 | -------------------------------------------------------------------------------- /configs/pointpillars/hv_pointpillars_fpn_sbn-all_2x8_2x_lyft-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_fpn_lyft.py', 3 | '../_base_/datasets/lyft-3d.py', '../_base_/schedules/schedule_2x.py', 4 | '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/pointpillars/hv_pointpillars_fpn_sbn-all_4x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_fpn_nus.py', 3 | '../_base_/datasets/nus-3d.py', '../_base_/schedules/schedule_2x.py', 4 | '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/pointpillars/hv_pointpillars_fpn_sbn-all_range100_2x8_2x_lyft-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_fpn_range100_lyft.py', 3 | '../_base_/datasets/range100_lyft-3d.py', 4 | '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/pointpillars/hv_pointpillars_secfpn_sbn_2x16_2x_waymo-3d-3class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_secfpn_waymo.py', 3 | '../_base_/datasets/waymoD5-3d-3class.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | 8 | # data settings 9 | data = dict(train=dict(dataset=dict(load_interval=1))) 10 | -------------------------------------------------------------------------------- /configs/pointpillars/hv_pointpillars_secfpn_sbn_2x16_2x_waymo-3d-car.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_secfpn_waymo.py', 3 | '../_base_/datasets/waymoD5-3d-car.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | 8 | # data settings 9 | data = dict(train=dict(dataset=dict(load_interval=1))) 10 | 11 | # model settings 12 | model = dict( 13 | type='MVXFasterRCNN', 14 | pts_bbox_head=dict( 15 | type='Anchor3DHead', 16 | num_classes=1, 17 | anchor_generator=dict( 18 | type='AlignedAnchor3DRangeGenerator', 19 | ranges=[[-74.88, -74.88, -0.0345, 74.88, 74.88, -0.0345]], 20 | sizes=[[2.08, 4.73, 1.77]], 21 | rotations=[0, 1.57], 22 | reshape_out=True)), 23 | # model training and testing settings 24 | train_cfg=dict( 25 | _delete_=True, 26 | pts=dict( 27 | assigner=dict( 28 | type='MaxIoUAssigner', 29 | iou_calculator=dict(type='BboxOverlapsNearest3D'), 30 | pos_iou_thr=0.55, 31 | neg_iou_thr=0.4, 32 | min_pos_iou=0.4, 33 | ignore_iof_thr=-1), 34 | allowed_border=0, 35 | code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 36 | pos_weight=-1, 37 | debug=False))) 38 | -------------------------------------------------------------------------------- /configs/pointpillars/hv_pointpillars_secfpn_sbn_2x16_2x_waymoD5-3d-3class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_secfpn_waymo.py', 3 | '../_base_/datasets/waymoD5-3d-3class.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | -------------------------------------------------------------------------------- /configs/pointpillars/hv_pointpillars_secfpn_sbn_2x16_2x_waymoD5-3d-car.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_secfpn_waymo.py', 3 | '../_base_/datasets/waymoD5-3d-car.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | 8 | # model settings 9 | model = dict( 10 | type='MVXFasterRCNN', 11 | pts_bbox_head=dict( 12 | type='Anchor3DHead', 13 | num_classes=1, 14 | anchor_generator=dict( 15 | type='AlignedAnchor3DRangeGenerator', 16 | ranges=[[-74.88, -74.88, -0.0345, 74.88, 74.88, -0.0345]], 17 | sizes=[[2.08, 4.73, 1.77]], 18 | rotations=[0, 1.57], 19 | reshape_out=True)), 20 | # model training and testing settings 21 | train_cfg=dict( 22 | _delete_=True, 23 | pts=dict( 24 | assigner=dict( 25 | type='MaxIoUAssigner', 26 | iou_calculator=dict(type='BboxOverlapsNearest3D'), 27 | pos_iou_thr=0.55, 28 | neg_iou_thr=0.4, 29 | min_pos_iou=0.4, 30 | ignore_iof_thr=-1), 31 | allowed_border=0, 32 | code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 33 | pos_weight=-1, 34 | debug=False))) 35 | -------------------------------------------------------------------------------- /configs/regnet/hv_pointpillars_regnet-1.6gf_fpn_sbn-all_4x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_fpn_nus.py', 3 | '../_base_/datasets/nus-3d.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | # model settings 8 | model = dict( 9 | type='MVXFasterRCNN', 10 | pretrained=dict(pts='open-mmlab://regnetx_1.6gf'), 11 | pts_backbone=dict( 12 | _delete_=True, 13 | type='NoStemRegNet', 14 | arch='regnetx_1.6gf', 15 | out_indices=(1, 2, 3), 16 | frozen_stages=-1, 17 | strides=(1, 2, 2, 2), 18 | base_channels=64, 19 | stem_channels=64, 20 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 21 | norm_eval=False, 22 | style='pytorch'), 23 | pts_neck=dict(in_channels=[168, 408, 912])) 24 | -------------------------------------------------------------------------------- /configs/regnet/hv_pointpillars_regnet-400mf_fpn_sbn-all_2x8_2x_lyft-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_fpn_lyft.py', 3 | '../_base_/datasets/lyft-3d.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | # model settings 8 | model = dict( 9 | type='MVXFasterRCNN', 10 | pretrained=dict(pts='open-mmlab://regnetx_400mf'), 11 | pts_backbone=dict( 12 | _delete_=True, 13 | type='NoStemRegNet', 14 | arch=dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0), 15 | out_indices=(1, 2, 3), 16 | frozen_stages=-1, 17 | strides=(1, 2, 2, 2), 18 | base_channels=64, 19 | stem_channels=64, 20 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 21 | norm_eval=False, 22 | style='pytorch'), 23 | pts_neck=dict(in_channels=[64, 160, 384])) 24 | -------------------------------------------------------------------------------- /configs/regnet/hv_pointpillars_regnet-400mf_fpn_sbn-all_4x8_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_fpn_nus.py', 3 | '../_base_/datasets/nus-3d.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | # model settings 8 | model = dict( 9 | type='MVXFasterRCNN', 10 | pretrained=dict(pts='open-mmlab://regnetx_400mf'), 11 | pts_backbone=dict( 12 | _delete_=True, 13 | type='NoStemRegNet', 14 | arch=dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0), 15 | out_indices=(1, 2, 3), 16 | frozen_stages=-1, 17 | strides=(1, 2, 2, 2), 18 | base_channels=64, 19 | stem_channels=64, 20 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 21 | norm_eval=False, 22 | style='pytorch'), 23 | pts_neck=dict(in_channels=[64, 160, 384])) 24 | -------------------------------------------------------------------------------- /configs/regnet/hv_pointpillars_regnet-400mf_fpn_sbn-all_range100_2x8_2x_lyft-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_pointpillars_fpn_range100_lyft.py', 3 | '../_base_/datasets/range100_lyft-3d.py', 4 | '../_base_/schedules/schedule_2x.py', 5 | '../_base_/default_runtime.py', 6 | ] 7 | # model settings 8 | model = dict( 9 | type='MVXFasterRCNN', 10 | pretrained=dict(pts='open-mmlab://regnetx_400mf'), 11 | pts_backbone=dict( 12 | _delete_=True, 13 | type='NoStemRegNet', 14 | arch=dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0), 15 | out_indices=(1, 2, 3), 16 | frozen_stages=-1, 17 | strides=(1, 2, 2, 2), 18 | base_channels=64, 19 | stem_channels=64, 20 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 21 | norm_eval=False, 22 | style='pytorch'), 23 | pts_neck=dict(in_channels=[64, 160, 384])) 24 | -------------------------------------------------------------------------------- /configs/second/hv_second_secfpn_6x8_80e_kitti-3d-3class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_second_secfpn_kitti.py', 3 | '../_base_/datasets/kitti-3d-3class.py', 4 | '../_base_/schedules/cyclic_40e.py', '../_base_/default_runtime.py' 5 | ] 6 | -------------------------------------------------------------------------------- /configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/models/hv_second_secfpn_kitti.py', 3 | '../_base_/datasets/kitti-3d-car.py', '../_base_/schedules/cyclic_40e.py', 4 | '../_base_/default_runtime.py' 5 | ] 6 | point_cloud_range = [0, -40, -3, 70.4, 40, 1] 7 | model = dict( 8 | bbox_head=dict( 9 | type='Anchor3DHead', 10 | num_classes=1, 11 | anchor_generator=dict( 12 | _delete_=True, 13 | type='Anchor3DRangeGenerator', 14 | ranges=[[0, -40.0, -1.78, 70.4, 40.0, -1.78]], 15 | sizes=[[1.6, 3.9, 1.56]], 16 | rotations=[0, 1.57], 17 | reshape_out=True)), 18 | # model training and testing settings 19 | train_cfg=dict( 20 | _delete_=True, 21 | assigner=dict( 22 | type='MaxIoUAssigner', 23 | iou_calculator=dict(type='BboxOverlapsNearest3D'), 24 | pos_iou_thr=0.6, 25 | neg_iou_thr=0.45, 26 | min_pos_iou=0.45, 27 | ignore_iof_thr=-1), 28 | allowed_border=0, 29 | pos_weight=-1, 30 | debug=False)) 31 | -------------------------------------------------------------------------------- /configs/ssn/hv_ssn_regnet-400mf_secfpn_sbn-all_1x16_2x_lyft-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = './hv_ssn_secfpn_sbn-all_2x16_2x_lyft-3d.py' 2 | # model settings 3 | model = dict( 4 | type='MVXFasterRCNN', 5 | pretrained=dict(pts='open-mmlab://regnetx_400mf'), 6 | pts_backbone=dict( 7 | _delete_=True, 8 | type='NoStemRegNet', 9 | arch=dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0), 10 | out_indices=(1, 2, 3), 11 | frozen_stages=-1, 12 | strides=(1, 2, 2, 2), 13 | base_channels=64, 14 | stem_channels=64, 15 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 16 | norm_eval=False, 17 | style='pytorch'), 18 | pts_neck=dict(in_channels=[64, 160, 384])) 19 | # dataset settings 20 | data = dict(samples_per_gpu=1, workers_per_gpu=2) 21 | -------------------------------------------------------------------------------- /configs/ssn/hv_ssn_regnet-400mf_secfpn_sbn-all_2x16_2x_nus-3d.py: -------------------------------------------------------------------------------- 1 | _base_ = './hv_ssn_secfpn_sbn-all_2x16_2x_nus-3d.py' 2 | # model settings 3 | model = dict( 4 | type='MVXFasterRCNN', 5 | pretrained=dict(pts='open-mmlab://regnetx_400mf'), 6 | pts_backbone=dict( 7 | _delete_=True, 8 | type='NoStemRegNet', 9 | arch=dict(w0=24, wa=24.48, wm=2.54, group_w=16, depth=22, bot_mul=1.0), 10 | out_indices=(1, 2, 3), 11 | frozen_stages=-1, 12 | strides=(1, 2, 2, 2), 13 | base_channels=64, 14 | stem_channels=64, 15 | norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), 16 | norm_eval=False, 17 | style='pytorch'), 18 | pts_neck=dict(in_channels=[64, 160, 384])) 19 | -------------------------------------------------------------------------------- /configs/votenet/votenet_16x8_sunrgbd-3d-10class.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | '../_base_/datasets/sunrgbd-3d-10class.py', '../_base_/models/votenet.py', 3 | '../_base_/schedules/schedule_3x.py', '../_base_/default_runtime.py' 4 | ] 5 | # model settings 6 | model = dict( 7 | bbox_head=dict( 8 | num_classes=10, 9 | bbox_coder=dict( 10 | type='PartialBinBasedBBoxCoder', 11 | num_sizes=10, 12 | num_dir_bins=12, 13 | with_rot=True, 14 | mean_sizes=[ 15 | [2.114256, 1.620300, 0.927272], [0.791118, 1.279516, 0.718182], 16 | [0.923508, 1.867419, 0.845495], [0.591958, 0.552978, 0.827272], 17 | [0.699104, 0.454178, 0.75625], [0.69519, 1.346299, 0.736364], 18 | [0.528526, 1.002642, 1.172878], [0.500618, 0.632163, 0.683424], 19 | [0.404671, 1.071108, 1.688889], [0.76584, 1.398258, 0.472728] 20 | ]), 21 | )) 22 | -------------------------------------------------------------------------------- /configs/votenet/votenet_iouloss_8x8_scannet-3d-18class.py: -------------------------------------------------------------------------------- 1 | _base_ = ['./votenet_8x8_scannet-3d-18class.py'] 2 | 3 | # model settings, add iou loss 4 | model = dict( 5 | bbox_head=dict( 6 | iou_loss=dict( 7 | type='AxisAlignedIoULoss', reduction='sum', loss_weight=10.0 / 8 | 3.0))) 9 | -------------------------------------------------------------------------------- /data/s3dis/meta_data/class_names.txt: -------------------------------------------------------------------------------- 1 | ceiling 2 | floor 3 | wall 4 | beam 5 | column 6 | window 7 | door 8 | table 9 | chair 10 | sofa 11 | bookcase 12 | board 13 | clutter 14 | -------------------------------------------------------------------------------- /data/scannet/meta_data/scannet_means.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/data/scannet/meta_data/scannet_means.npz -------------------------------------------------------------------------------- /demo/data/kitti/kitti_000008.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/kitti/kitti_000008.bin -------------------------------------------------------------------------------- /demo/data/kitti/kitti_000008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/kitti/kitti_000008.png -------------------------------------------------------------------------------- /demo/data/kitti/kitti_000008_infos.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/kitti/kitti_000008_infos.pkl -------------------------------------------------------------------------------- /demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525.jpg -------------------------------------------------------------------------------- /demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525_mono3d.coco.json: -------------------------------------------------------------------------------- 1 | {"images": [{"file_name": "samples/CAM_BACK/n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525.jpg", "cam_intrinsic": [[809.2209905677063, 0.0, 829.2196003259838], [0.0, 809.2209905677063, 481.77842384512485], [0.0, 0.0, 1.0]]}]} 2 | -------------------------------------------------------------------------------- /demo/data/scannet/scene0000_00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/scannet/scene0000_00.bin -------------------------------------------------------------------------------- /demo/data/sunrgbd/sunrgbd_000017.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/sunrgbd/sunrgbd_000017.bin -------------------------------------------------------------------------------- /demo/data/sunrgbd/sunrgbd_000017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/sunrgbd/sunrgbd_000017.jpg -------------------------------------------------------------------------------- /demo/data/sunrgbd/sunrgbd_000017_infos.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/demo/data/sunrgbd/sunrgbd_000017_infos.pkl -------------------------------------------------------------------------------- /demo/pc_seg_demo.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | 3 | from mmdet3d.apis import inference_segmentor, init_model, show_result_meshlab 4 | 5 | 6 | def main(): 7 | parser = ArgumentParser() 8 | parser.add_argument('pcd', help='Point cloud file') 9 | parser.add_argument('config', help='Config file') 10 | parser.add_argument('checkpoint', help='Checkpoint file') 11 | parser.add_argument( 12 | '--device', default='cuda:0', help='Device used for inference') 13 | parser.add_argument( 14 | '--out-dir', type=str, default='demo', help='dir to save results') 15 | parser.add_argument( 16 | '--show', action='store_true', help='show online visuliaztion results') 17 | parser.add_argument( 18 | '--snapshot', 19 | action='store_true', 20 | help='whether to save online visuliaztion results') 21 | args = parser.parse_args() 22 | 23 | # build the model from a config file and a checkpoint file 24 | model = init_model(args.config, args.checkpoint, device=args.device) 25 | # test a single image 26 | result, data = inference_segmentor(model, args.pcd) 27 | # show the results 28 | show_result_meshlab( 29 | data, 30 | result, 31 | args.out_dir, 32 | show=args.show, 33 | snapshot=args.snapshot, 34 | task='seg', 35 | palette=model.PALETTE) 36 | 37 | 38 | if __name__ == '__main__': 39 | main() 40 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PYTORCH="1.6.0" 2 | ARG CUDA="10.1" 3 | ARG CUDNN="7" 4 | 5 | FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel 6 | 7 | ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX" 8 | ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all" 9 | ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" 10 | 11 | RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \ 12 | && apt-get clean \ 13 | && rm -rf /var/lib/apt/lists/* 14 | 15 | # Install MMCV, MMDetection and MMSegmentation 16 | RUN pip install mmcv-full==latest+torch1.6.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html 17 | RUN pip install mmdet==2.11.0 18 | RUN pip install mmsegmentation==0.14.0 19 | 20 | # Install MMDetection3D 21 | RUN conda clean --all 22 | RUN git clone https://github.com/open-mmlab/mmdetection3d.git /mmdetection3d 23 | WORKDIR /mmdetection3d 24 | ENV FORCE_CUDA="1" 25 | RUN pip install -r requirements/build.txt 26 | RUN pip install --no-cache-dir -e . 27 | 28 | # uninstall pycocotools installed by nuscenes-devkit and reinstall mmpycocotools 29 | RUN pip uninstall pycocotools --no-cache-dir -y 30 | RUN pip install mmpycocotools --no-cache-dir --force --no-deps 31 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/datasets/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | :maxdepth: 2 3 | 4 | scannet_det.md 5 | waymo_det.md 6 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to MMDetection3D's documentation! 2 | ========================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Get Started 7 | 8 | getting_started.md 9 | demo.md 10 | model_zoo.md 11 | data_preparation.md 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | :caption: Quick Run 16 | 17 | 1_exist_data_model.md 18 | 2_new_data_model.md 19 | 20 | .. toctree:: 21 | :maxdepth: 2 22 | :caption: Supported Tasks 23 | 24 | supported_tasks/index.rst 25 | 26 | .. toctree:: 27 | :maxdepth: 2 28 | :caption: Datasets 29 | 30 | datasets/index.rst 31 | 32 | .. toctree:: 33 | :maxdepth: 2 34 | :caption: Tutorials 35 | 36 | tutorials/index.rst 37 | 38 | .. toctree:: 39 | :maxdepth: 2 40 | :caption: Useful Tools and Scripts 41 | 42 | useful_tools.md 43 | 44 | .. toctree:: 45 | :maxdepth: 2 46 | :caption: Notes 47 | 48 | benchmarks.md 49 | faq.md 50 | compatibility.md 51 | 52 | .. toctree:: 53 | :caption: API Reference 54 | 55 | api.rst 56 | 57 | .. toctree:: 58 | :caption: 语言切换 59 | 60 | switch_language.md 61 | 62 | Indices and tables 63 | ================== 64 | 65 | * :ref:`genindex` 66 | * :ref:`search` 67 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/supported_tasks/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | :maxdepth: 2 3 | 4 | lidar_det3d.md 5 | vision_det3d.md 6 | lidar_sem_seg3d.md 7 | -------------------------------------------------------------------------------- /docs/switch_language.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/docs/switch_language.md -------------------------------------------------------------------------------- /docs/tutorials/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | :maxdepth: 2 3 | 4 | config.md 5 | customize_dataset.md 6 | data_pipeline.md 7 | customize_models.md 8 | customize_runtime.md 9 | -------------------------------------------------------------------------------- /docs_zh-CN/0_demo.md: -------------------------------------------------------------------------------- 1 | # 0: 演示 -------------------------------------------------------------------------------- /docs_zh-CN/1_exist_data_model.md: -------------------------------------------------------------------------------- 1 | # 1: 使用已有模型在标准数据集上进行推理 2 | -------------------------------------------------------------------------------- /docs_zh-CN/2_new_data_model.md: -------------------------------------------------------------------------------- 1 | # 2: 在自定义数据集上进行训练 2 | -------------------------------------------------------------------------------- /docs_zh-CN/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs_zh-CN/data_preparation.md: -------------------------------------------------------------------------------- 1 | # 数据预处理 2 | -------------------------------------------------------------------------------- /docs_zh-CN/faq.md: -------------------------------------------------------------------------------- 1 | # 常见问题解答 2 | -------------------------------------------------------------------------------- /docs_zh-CN/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to MMDetection3D's documentation! 2 | ========================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: 开始你的第一步 7 | 8 | getting_started.md 9 | model_zoo.md 10 | data_preparation.md 11 | 12 | .. toctree:: 13 | :maxdepth: 2 14 | :caption: 快速启动 15 | 16 | 0_demo.md 17 | 1_exist_data_model.md 18 | 2_new_data_model.md 19 | 20 | .. toctree:: 21 | :maxdepth: 2 22 | :caption: 教程 23 | 24 | tutorials/index.rst 25 | 26 | .. toctree:: 27 | :maxdepth: 2 28 | :caption: 实用工具与脚本 29 | 30 | useful_tools.md 31 | 32 | .. toctree:: 33 | :maxdepth: 2 34 | :caption: 说明 35 | 36 | faq.md 37 | 38 | .. toctree:: 39 | :caption: 语言切换 40 | 41 | switch_language.md 42 | 43 | .. toctree:: 44 | :caption: 接口文档(英文) 45 | 46 | api.rst 47 | 48 | Indices and tables 49 | ================== 50 | 51 | * :ref:`genindex` 52 | * :ref:`search` 53 | -------------------------------------------------------------------------------- /docs_zh-CN/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs_zh-CN/model_zoo.md: -------------------------------------------------------------------------------- 1 | # 模型库 2 | -------------------------------------------------------------------------------- /docs_zh-CN/switch_language.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divadi/DetMatch/c56efb167c0a710490b184939acdf59965f43a50/docs_zh-CN/switch_language.md -------------------------------------------------------------------------------- /docs_zh-CN/tutorials/config.md: -------------------------------------------------------------------------------- 1 | # 教程 1: 配置文件 2 | -------------------------------------------------------------------------------- /docs_zh-CN/tutorials/customize_dataset.md: -------------------------------------------------------------------------------- 1 | # 教程 2: 自定义数据集 -------------------------------------------------------------------------------- /docs_zh-CN/tutorials/customize_models.md: -------------------------------------------------------------------------------- 1 | # 教程 4: 自定义模型 2 | -------------------------------------------------------------------------------- /docs_zh-CN/tutorials/customize_runtime.md: -------------------------------------------------------------------------------- 1 | # 教程 5: 自定义训练配置 -------------------------------------------------------------------------------- /docs_zh-CN/tutorials/data_pipeline.md: -------------------------------------------------------------------------------- 1 | # 教程 3: 自定义数据预处理流程 -------------------------------------------------------------------------------- /docs_zh-CN/tutorials/index.rst: -------------------------------------------------------------------------------- 1 | .. toctree:: 2 | :maxdepth: 2 3 | 4 | config.md 5 | customize_dataset.md 6 | data_pipeline.md 7 | customize_models.md 8 | customize_runtime.md 9 | waymo.md 10 | -------------------------------------------------------------------------------- /docs_zh-CN/tutorials/waymo.md: -------------------------------------------------------------------------------- 1 | # 教程 6: Waymo 数据集 -------------------------------------------------------------------------------- /docs_zh-CN/useful_tools.md: -------------------------------------------------------------------------------- 1 | # 实用工具 -------------------------------------------------------------------------------- /mmdet3d/apis/__init__.py: -------------------------------------------------------------------------------- 1 | from .inference import (convert_SyncBN, inference_detector, 2 | inference_mono_3d_detector, 3 | inference_multi_modality_detector, inference_segmentor, 4 | init_model, show_result_meshlab) 5 | from .test import single_gpu_test 6 | from .train import train_model 7 | from .ssl_train import train_ssl_detector 8 | 9 | __all__ = [ 10 | 'inference_detector', 'init_model', 'single_gpu_test', 11 | 'inference_mono_3d_detector', 'show_result_meshlab', 'convert_SyncBN', 12 | 'train_model', 'inference_multi_modality_detector', 'inference_segmentor', 13 | 'train_ssl_detector' 14 | ] 15 | -------------------------------------------------------------------------------- /mmdet3d/apis/train.py: -------------------------------------------------------------------------------- 1 | from mmdet.apis import train_detector 2 | from mmseg.apis import train_segmentor 3 | 4 | 5 | def train_model(model, 6 | dataset, 7 | cfg, 8 | distributed=False, 9 | validate=False, 10 | timestamp=None, 11 | meta=None): 12 | """A function wrapper for launching model training according to cfg. 13 | 14 | Because we need different eval_hook in runner. Should be deprecated in the 15 | future. 16 | """ 17 | if cfg.model.type in ['EncoderDecoder3D']: 18 | train_segmentor( 19 | model, 20 | dataset, 21 | cfg, 22 | distributed=distributed, 23 | validate=validate, 24 | timestamp=timestamp, 25 | meta=meta) 26 | else: 27 | train_detector( 28 | model, 29 | dataset, 30 | cfg, 31 | distributed=distributed, 32 | validate=validate, 33 | timestamp=timestamp, 34 | meta=meta) 35 | -------------------------------------------------------------------------------- /mmdet3d/core/__init__.py: -------------------------------------------------------------------------------- 1 | from .anchor import * # noqa: F401, F403 2 | from .bbox import * # noqa: F401, F403 3 | from .evaluation import * # noqa: F401, F403 4 | from .optimizer import * 5 | from .points import * # noqa: F401, F403 6 | from .post_processing import * # noqa: F401, F403 7 | from .utils import * # noqa: F401, F403 8 | from .visualizer import * # noqa: F401, F403 9 | from .voxel import * # noqa: F401, F403 10 | -------------------------------------------------------------------------------- /mmdet3d/core/anchor/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.core.anchor import build_anchor_generator 2 | from .anchor_3d_generator import (AlignedAnchor3DRangeGenerator, 3 | AlignedAnchor3DRangeGeneratorPerCls, 4 | Anchor3DRangeGenerator) 5 | 6 | __all__ = [ 7 | 'AlignedAnchor3DRangeGenerator', 'Anchor3DRangeGenerator', 8 | 'build_anchor_generator', 'AlignedAnchor3DRangeGeneratorPerCls' 9 | ] 10 | -------------------------------------------------------------------------------- /mmdet3d/core/bbox/assigners/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.core.bbox import AssignResult, BaseAssigner, MaxIoUAssigner 2 | from .modified_hungarian_assigner import ModHungarianAssigner 3 | 4 | __all__ = ['BaseAssigner', 'MaxIoUAssigner', 'AssignResult', 'ModHungarianAssigner'] 5 | -------------------------------------------------------------------------------- /mmdet3d/core/bbox/coders/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.core.bbox import build_bbox_coder 2 | from .anchor_free_bbox_coder import AnchorFreeBBoxCoder 3 | from .centerpoint_bbox_coders import CenterPointBBoxCoder 4 | from .delta_xyzwhlr_bbox_coder import DeltaXYZWLHRBBoxCoder 5 | from .groupfree3d_bbox_coder import GroupFree3DBBoxCoder 6 | from .partial_bin_based_bbox_coder import PartialBinBasedBBoxCoder 7 | 8 | __all__ = [ 9 | 'build_bbox_coder', 'DeltaXYZWLHRBBoxCoder', 'PartialBinBasedBBoxCoder', 10 | 'CenterPointBBoxCoder', 'AnchorFreeBBoxCoder', 'GroupFree3DBBoxCoder' 11 | ] 12 | -------------------------------------------------------------------------------- /mmdet3d/core/bbox/iou_calculators/__init__.py: -------------------------------------------------------------------------------- 1 | from .iou3d_calculator import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D, 2 | BboxOverlapsNearest3D, 3 | axis_aligned_bbox_overlaps_3d, bbox_overlaps_3d, 4 | bbox_overlaps_nearest_3d) 5 | 6 | __all__ = [ 7 | 'BboxOverlapsNearest3D', 'BboxOverlaps3D', 'bbox_overlaps_nearest_3d', 8 | 'bbox_overlaps_3d', 'AxisAlignedBboxOverlaps3D', 9 | 'axis_aligned_bbox_overlaps_3d' 10 | ] 11 | -------------------------------------------------------------------------------- /mmdet3d/core/bbox/match_costs/__init__.py: -------------------------------------------------------------------------------- 1 | from .modified_match_cost import * -------------------------------------------------------------------------------- /mmdet3d/core/bbox/match_costs/modified_match_cost.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | from mmdet.core.bbox.iou_calculators import bbox_overlaps 4 | from mmdet.core.bbox.transforms import bbox_cxcywh_to_xyxy, bbox_xyxy_to_cxcywh 5 | from mmdet.core.bbox.match_costs.builder import MATCH_COST 6 | from mmdet.core.bbox.match_costs import FocalLossCost 7 | 8 | @MATCH_COST.register_module() 9 | class DoubleSidedFocalLossCost: 10 | def __init__(self, **kwargs): 11 | self.focal_loss_cost = FocalLossCost(**kwargs) 12 | 13 | def __call__(self, cls_pred_1, cls_pred_2): 14 | """ 15 | Idea is to argmax cls_pred_1 to get label, compute loss vs cls_pred_2, 16 | and vice versa. 17 | Args: 18 | cls_pred_1 (Tensor): Predicted classification logits, shape 19 | [num_query, num_class]. 20 | cls_pred_2: same as 1 21 | Returns: 22 | torch.Tensor: cls_cost value with weight 23 | """ 24 | assert cls_pred_1.shape[1] == cls_pred_2.shape[1] 25 | 26 | cls_pred_1_sigmoid = cls_pred_1.sigmoid() 27 | cls_pred_2_sigmoid = cls_pred_2.sigmoid() 28 | 29 | cls_label_1 = cls_pred_1_sigmoid.argmax(dim=1) 30 | cls_label_2 = cls_pred_2_sigmoid.argmax(dim=1) 31 | 32 | return (self.focal_loss_cost(cls_pred_1, cls_label_2) + 33 | self.focal_loss_cost(cls_pred_2, cls_label_1).t()) / 2 -------------------------------------------------------------------------------- /mmdet3d/core/bbox/samplers/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.core.bbox.samplers import (BaseSampler, CombinedSampler, 2 | InstanceBalancedPosSampler, 3 | IoUBalancedNegSampler, OHEMSampler, 4 | PseudoSampler, RandomSampler, 5 | SamplingResult) 6 | from .iou_neg_piecewise_sampler import IoUNegPiecewiseSampler 7 | 8 | __all__ = [ 9 | 'BaseSampler', 'PseudoSampler', 'RandomSampler', 10 | 'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler', 11 | 'OHEMSampler', 'SamplingResult', 'IoUNegPiecewiseSampler' 12 | ] 13 | -------------------------------------------------------------------------------- /mmdet3d/core/bbox/structures/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_box3d import BaseInstance3DBoxes 2 | from .box_3d_mode import Box3DMode 3 | from .cam_box3d import CameraInstance3DBoxes 4 | from .coord_3d_mode import Coord3DMode 5 | from .depth_box3d import DepthInstance3DBoxes 6 | from .lidar_box3d import LiDARInstance3DBoxes 7 | from .utils import (get_box_type, limit_period, mono_cam_box2vis, 8 | points_cam2img, rotation_3d_in_axis, xywhr2xyxyr) 9 | 10 | __all__ = [ 11 | 'Box3DMode', 'BaseInstance3DBoxes', 'LiDARInstance3DBoxes', 12 | 'CameraInstance3DBoxes', 'DepthInstance3DBoxes', 'xywhr2xyxyr', 13 | 'get_box_type', 'rotation_3d_in_axis', 'limit_period', 'points_cam2img', 14 | 'Coord3DMode', 'mono_cam_box2vis' 15 | ] 16 | -------------------------------------------------------------------------------- /mmdet3d/core/evaluation/__init__.py: -------------------------------------------------------------------------------- 1 | from .indoor_eval import indoor_eval 2 | from .kitti_utils import kitti_eval, kitti_eval_coco_style 3 | from .lyft_eval import lyft_eval 4 | from .seg_eval import seg_eval 5 | 6 | __all__ = [ 7 | 'kitti_eval_coco_style', 'kitti_eval', 'indoor_eval', 'lyft_eval', 8 | 'seg_eval' 9 | ] 10 | -------------------------------------------------------------------------------- /mmdet3d/core/evaluation/kitti_utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .eval import kitti_eval, kitti_eval_coco_style 2 | 3 | __all__ = ['kitti_eval', 'kitti_eval_coco_style'] 4 | -------------------------------------------------------------------------------- /mmdet3d/core/optimizer/__init__.py: -------------------------------------------------------------------------------- 1 | from .hybrid_constructor import HybridOptimizerConstructor 2 | from .hybrid_optimizer import HybridOptimizer 3 | 4 | __all__ = ['HybridOptimizerConstructor', 'HybridOptimizer'] -------------------------------------------------------------------------------- /mmdet3d/core/points/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_points import BasePoints 2 | from .cam_points import CameraPoints 3 | from .depth_points import DepthPoints 4 | from .lidar_points import LiDARPoints 5 | 6 | __all__ = ['BasePoints', 'CameraPoints', 'DepthPoints', 'LiDARPoints'] 7 | 8 | 9 | def get_points_type(points_type): 10 | """Get the class of points according to coordinate type. 11 | 12 | Args: 13 | points_type (str): The type of points coordinate. 14 | The valid value are "CAMERA", "LIDAR", or "DEPTH". 15 | 16 | Returns: 17 | class: Points type. 18 | """ 19 | if points_type == 'CAMERA': 20 | points_cls = CameraPoints 21 | elif points_type == 'LIDAR': 22 | points_cls = LiDARPoints 23 | elif points_type == 'DEPTH': 24 | points_cls = DepthPoints 25 | else: 26 | raise ValueError('Only "points_type" of "CAMERA", "LIDAR", or "DEPTH"' 27 | f' are supported, got {points_type}') 28 | 29 | return points_cls 30 | -------------------------------------------------------------------------------- /mmdet3d/core/post_processing/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.core.post_processing import (merge_aug_bboxes, merge_aug_masks, 2 | merge_aug_proposals, merge_aug_scores, 3 | multiclass_nms) 4 | from .box3d_nms import aligned_3d_nms, box3d_multiclass_nms, circle_nms 5 | from .merge_augs import merge_aug_bboxes_3d 6 | 7 | __all__ = [ 8 | 'multiclass_nms', 'merge_aug_proposals', 'merge_aug_bboxes', 9 | 'merge_aug_scores', 'merge_aug_masks', 'box3d_multiclass_nms', 10 | 'aligned_3d_nms', 'merge_aug_bboxes_3d', 'circle_nms' 11 | ] 12 | -------------------------------------------------------------------------------- /mmdet3d/core/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .frozen_bn import FrozenBatchNorm1d, FrozenBatchNorm2d 2 | from .gaussian import draw_heatmap_gaussian, gaussian_2d, gaussian_radius 3 | from .model_iter_epoch import ModelIterEpochHook 4 | from .multi_step_multi_lr import MultiStepMultiLrUpdaterHook 5 | from .wandb_vis_hook import WandbVisHook 6 | 7 | __all__ = [ 8 | 'gaussian_2d', 'gaussian_radius', 'draw_heatmap_gaussian', 9 | 'ModelIterEpochHook', 'MultiStepMultiLrUpdaterHook', 'WandbVisHook', 10 | 'FrozenBatchNorm1d', 'FrozenBatchNorm2d' 11 | ] -------------------------------------------------------------------------------- /mmdet3d/core/utils/model_iter_epoch.py: -------------------------------------------------------------------------------- 1 | """We define a simple hook that gives the runner's "iter" and "epoch" 2 | attributes to the model. 3 | 4 | For some reason, runner.epoch is 0 over the first two epochs, and 1 for the 5 | third, 2 for the fourth, etc. 6 | However, when resuming the checkpoint after first epoch, runner.epoch is 7 | 1. For checkpoint after second epoch, is 2. 8 | This would be an issue, but when resuming the checkpoint after the second 9 | epoch, is 2 but is also 2 for the epoch after that. then, it resumes to 3. 10 | 11 | My solution is the "-1" below, in before_run. So when starting training, 12 | from scratch would go -1, 0, 1, ... 13 | from checkpoint "i" would go i-1, i, i+1, ... 14 | """ 15 | from mmcv.runner import HOOKS, Hook 16 | 17 | 18 | @HOOKS.register_module() 19 | class ModelIterEpochHook(Hook): 20 | 21 | def before_run(self, runner): 22 | runner.model.module.iter = runner.iter 23 | runner.model.module.epoch = runner.epoch - 1 24 | 25 | def after_train_iter(self, runner): 26 | runner.model.module.iter = runner.iter 27 | 28 | def after_train_epoch(self, runner): 29 | runner.model.module.epoch = runner.epoch -------------------------------------------------------------------------------- /mmdet3d/core/visualizer/__init__.py: -------------------------------------------------------------------------------- 1 | from .show_result import (show_multi_modality_result, show_result, 2 | show_seg_result) 3 | 4 | __all__ = ['show_result', 'show_seg_result', 'show_multi_modality_result'] 5 | -------------------------------------------------------------------------------- /mmdet3d/core/voxel/__init__.py: -------------------------------------------------------------------------------- 1 | from .builder import build_voxel_generator 2 | from .voxel_generator import VoxelGenerator 3 | 4 | __all__ = ['build_voxel_generator', 'VoxelGenerator'] 5 | -------------------------------------------------------------------------------- /mmdet3d/core/voxel/builder.py: -------------------------------------------------------------------------------- 1 | import mmcv 2 | 3 | from . import voxel_generator 4 | 5 | 6 | def build_voxel_generator(cfg, **kwargs): 7 | """Builder of voxel generator.""" 8 | if isinstance(cfg, voxel_generator.VoxelGenerator): 9 | return cfg 10 | elif isinstance(cfg, dict): 11 | return mmcv.runner.obj_from_dict( 12 | cfg, voxel_generator, default_args=kwargs) 13 | else: 14 | raise TypeError('Invalid type {} for building a sampler'.format( 15 | type(cfg))) 16 | -------------------------------------------------------------------------------- /mmdet3d/datasets/teacher_student_ssl_dataset.py: -------------------------------------------------------------------------------- 1 | import copy 2 | import torch 3 | from mmcv.parallel import DataContainer as DC 4 | from torch.utils.data import Dataset 5 | 6 | from mmdet3d.datasets import build_dataset 7 | from mmdet.datasets import DATASETS 8 | from .pipelines import Compose 9 | 10 | 11 | @DATASETS.register_module() 12 | class TS_SSL_Dataset(Dataset): 13 | def __init__(self, 14 | dataset, 15 | student_pipeline=[], 16 | teacher_pipeline=[]): 17 | 18 | self.dataset = build_dataset(dataset) 19 | self.CLASSES = self.dataset.CLASSES 20 | if hasattr(self.dataset, 'flag'): 21 | self.flag = self.dataset.flag 22 | 23 | self.student_pipeline = Compose(student_pipeline) 24 | self.teacher_pipeline = Compose(teacher_pipeline) 25 | 26 | def __getitem__(self, idx): 27 | data = self.dataset[idx] 28 | student_data = self.student_pipeline(copy.deepcopy(data)) 29 | teacher_data = self.teacher_pipeline(data) 30 | 31 | return dict( 32 | stu=student_data, tea=teacher_data, img_metas=DC(torch.tensor([]))) 33 | 34 | def __len__(self): 35 | return len(self.dataset) -------------------------------------------------------------------------------- /mmdet3d/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .backbones import * # noqa: F401,F403 2 | from .builder import (FUSION_LAYERS, MIDDLE_ENCODERS, VOXEL_ENCODERS, 3 | build_backbone, build_detector, build_fusion_layer, 4 | build_head, build_loss, build_middle_encoder, 5 | build_model, build_neck, build_roi_extractor, 6 | build_shared_head, build_voxel_encoder) 7 | from .decode_heads import * # noqa: F401,F403 8 | from .dense_heads import * # noqa: F401,F403 9 | from .detectors import * # noqa: F401,F403 10 | from .fusion_layers import * # noqa: F401,F403 11 | from .losses import * # noqa: F401,F403 12 | from .middle_encoders import * # noqa: F401,F403 13 | from .model_utils import * # noqa: F401,F403 14 | from .necks import * # noqa: F401,F403 15 | from .roi_heads import * # noqa: F401,F403 16 | from .segmentors import * # noqa: F401,F403 17 | from .ssl_modules import * # noqa: F401,F403 18 | from .voxel_encoders import * # noqa: F401,F403 19 | 20 | __all__ = [ 21 | 'VOXEL_ENCODERS', 'MIDDLE_ENCODERS', 'FUSION_LAYERS', 'build_backbone', 22 | 'build_neck', 'build_roi_extractor', 'build_shared_head', 'build_head', 23 | 'build_loss', 'build_detector', 'build_fusion_layer', 'build_model', 24 | 'build_middle_encoder', 'build_voxel_encoder' 25 | ] 26 | -------------------------------------------------------------------------------- /mmdet3d/models/backbones/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.backbones import SSDVGG, HRNet, ResNet, ResNetV1d, ResNeXt 2 | from .multi_backbone import MultiBackbone 3 | from .nostem_regnet import NoStemRegNet 4 | from .pointnet2_sa_msg import PointNet2SAMSG 5 | from .pointnet2_sa_ssg import PointNet2SASSG 6 | from .second import SECOND 7 | 8 | __all__ = [ 9 | 'ResNet', 'ResNetV1d', 'ResNeXt', 'SSDVGG', 'HRNet', 'NoStemRegNet', 10 | 'SECOND', 'PointNet2SASSG', 'PointNet2SAMSG', 'MultiBackbone' 11 | ] 12 | -------------------------------------------------------------------------------- /mmdet3d/models/backbones/base_pointnet.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | from abc import ABCMeta 3 | from mmcv.runner import BaseModule 4 | 5 | 6 | class BasePointNet(BaseModule, metaclass=ABCMeta): 7 | """Base class for PointNet.""" 8 | 9 | def __init__(self, init_cfg=None, pretrained=None): 10 | super(BasePointNet, self).__init__(init_cfg) 11 | self.fp16_enabled = False 12 | assert not (init_cfg and pretrained), \ 13 | 'init_cfg and pretrained cannot be setting at the same time' 14 | if isinstance(pretrained, str): 15 | warnings.warn('DeprecationWarning: pretrained is a deprecated, ' 16 | 'please use "init_cfg" instead') 17 | self.init_cfg = dict(type='Pretrained', checkpoint=pretrained) 18 | 19 | @staticmethod 20 | def _split_point_feats(points): 21 | """Split coordinates and features of input points. 22 | 23 | Args: 24 | points (torch.Tensor): Point coordinates with features, 25 | with shape (B, N, 3 + input_feature_dim). 26 | 27 | Returns: 28 | torch.Tensor: Coordinates of input points. 29 | torch.Tensor: Features of input points. 30 | """ 31 | xyz = points[..., 0:3].contiguous() 32 | if points.size(-1) > 3: 33 | features = points[..., 3:].transpose(1, 2).contiguous() 34 | else: 35 | features = None 36 | 37 | return xyz, features 38 | -------------------------------------------------------------------------------- /mmdet3d/models/decode_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .pointnet2_head import PointNet2Head 2 | 3 | __all__ = ['PointNet2Head'] 4 | -------------------------------------------------------------------------------- /mmdet3d/models/dense_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .anchor3d_head import Anchor3DHead 2 | from .anchor_free_mono3d_head import AnchorFreeMono3DHead 3 | from .base_conv_bbox_head import BaseConvBboxHead 4 | from .base_mono3d_dense_head import BaseMono3DDenseHead 5 | from .centerpoint_head import CenterHead 6 | from .fcos_mono3d_head import FCOSMono3DHead 7 | from .free_anchor3d_head import FreeAnchor3DHead 8 | from .groupfree3d_head import GroupFree3DHead 9 | from .parta2_rpn_head import PartA2RPNHead 10 | from .shape_aware_head import ShapeAwareHead 11 | from .ssd_3d_head import SSD3DHead 12 | from .vote_head import VoteHead 13 | 14 | __all__ = [ 15 | 'Anchor3DHead', 'FreeAnchor3DHead', 'PartA2RPNHead', 'VoteHead', 16 | 'SSD3DHead', 'BaseConvBboxHead', 'CenterHead', 'ShapeAwareHead', 17 | 'BaseMono3DDenseHead', 'AnchorFreeMono3DHead', 'FCOSMono3DHead', 18 | 'GroupFree3DHead' 19 | ] 20 | -------------------------------------------------------------------------------- /mmdet3d/models/detectors/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import Base3DDetector 2 | from .centerpoint import CenterPoint 3 | from .dynamic_voxelnet import DynamicVoxelNet 4 | from .fcos_mono3d import FCOSMono3D 5 | from .groupfree3dnet import GroupFree3DNet 6 | from .h3dnet import H3DNet 7 | from .imvotenet import ImVoteNet 8 | from .imvoxelnet import ImVoxelNet 9 | from .mmdetector import MMDetector 10 | from .mvx_faster_rcnn import DynamicMVXFasterRCNN, MVXFasterRCNN 11 | from .mvx_two_stage import MVXTwoStageDetector 12 | from .openpcdet import OpenPCDetDetector 13 | from .parta2 import PartA2 14 | from .single_stage_mono3d import SingleStageMono3DDetector 15 | from .ssd3dnet import SSD3DNet 16 | from .ssl import SSL 17 | from .votenet import VoteNet 18 | from .voxelnet import VoxelNet 19 | 20 | __all__ = [ 21 | 'Base3DDetector', 'VoxelNet', 'DynamicVoxelNet', 'MVXTwoStageDetector', 22 | 'DynamicMVXFasterRCNN', 'MVXFasterRCNN', 'PartA2', 'VoteNet', 'H3DNet', 23 | 'CenterPoint', 'SSD3DNet', 'ImVoteNet', 'SingleStageMono3DDetector', 24 | 'FCOSMono3D', 'ImVoxelNet', 'GroupFree3DNet', 'SSL', 'MMDetector', 25 | 'OpenPCDetDetector' 26 | ] 27 | -------------------------------------------------------------------------------- /mmdet3d/models/detectors/fcos_mono3d.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.builder import DETECTORS 2 | from .single_stage_mono3d import SingleStageMono3DDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class FCOSMono3D(SingleStageMono3DDetector): 7 | r"""FCOS3D `_ for monocular 3D object detection. 8 | 9 | Currently please refer to our entry on the 10 | `leaderboard ` # noqa 11 | """ 12 | 13 | def __init__(self, 14 | backbone, 15 | neck, 16 | bbox_head, 17 | train_cfg=None, 18 | test_cfg=None, 19 | pretrained=None): 20 | super(FCOSMono3D, self).__init__(backbone, neck, bbox_head, train_cfg, 21 | test_cfg, pretrained) 22 | -------------------------------------------------------------------------------- /mmdet3d/models/detectors/ssd3dnet.py: -------------------------------------------------------------------------------- 1 | from mmdet.models import DETECTORS 2 | from .votenet import VoteNet 3 | 4 | 5 | @DETECTORS.register_module() 6 | class SSD3DNet(VoteNet): 7 | """3DSSDNet model. 8 | 9 | https://arxiv.org/abs/2002.10187.pdf 10 | """ 11 | 12 | def __init__(self, 13 | backbone, 14 | bbox_head=None, 15 | train_cfg=None, 16 | test_cfg=None, 17 | init_cfg=None, 18 | pretrained=None): 19 | super(SSD3DNet, self).__init__( 20 | backbone=backbone, 21 | bbox_head=bbox_head, 22 | train_cfg=train_cfg, 23 | test_cfg=test_cfg, 24 | init_cfg=init_cfg, 25 | pretrained=pretrained) 26 | -------------------------------------------------------------------------------- /mmdet3d/models/detectors/two_stage.py: -------------------------------------------------------------------------------- 1 | from mmdet.models import DETECTORS, TwoStageDetector 2 | from .base import Base3DDetector 3 | 4 | 5 | @DETECTORS.register_module() 6 | class TwoStage3DDetector(Base3DDetector, TwoStageDetector): 7 | """Base class of two-stage 3D detector. 8 | 9 | It inherits original ``:class:TwoStageDetector`` and 10 | ``:class:Base3DDetector``. This class could serve as a base class for all 11 | two-stage 3D detectors. 12 | """ 13 | 14 | def __init__(self, **kwargs): 15 | super(TwoStage3DDetector, self).__init__(**kwargs) 16 | -------------------------------------------------------------------------------- /mmdet3d/models/fusion_layers/__init__.py: -------------------------------------------------------------------------------- 1 | from .coord_transform import (apply_3d_transformation, bbox_2d_transform, 2 | coord_2d_transform) 3 | from .point_fusion import PointFusion 4 | from .vote_fusion import VoteFusion 5 | 6 | __all__ = [ 7 | 'PointFusion', 'VoteFusion', 'apply_3d_transformation', 8 | 'bbox_2d_transform', 'coord_2d_transform' 9 | ] 10 | -------------------------------------------------------------------------------- /mmdet3d/models/losses/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.losses import FocalLoss, SmoothL1Loss, binary_cross_entropy 2 | from .axis_aligned_iou_loss import AxisAlignedIoULoss, axis_aligned_iou_loss 3 | from .chamfer_distance import ChamferDistance, chamfer_distance 4 | from .softmax_focal_loss import SoftmaxFocalLoss 5 | 6 | __all__ = [ 7 | 'FocalLoss', 'SmoothL1Loss', 'binary_cross_entropy', 'ChamferDistance', 8 | 'chamfer_distance', 'axis_aligned_iou_loss', 'AxisAlignedIoULoss', 9 | 'SoftmaxFocalLoss' 10 | ] 11 | -------------------------------------------------------------------------------- /mmdet3d/models/middle_encoders/__init__.py: -------------------------------------------------------------------------------- 1 | from .pillar_scatter import PointPillarsScatter 2 | from .sparse_encoder import SparseEncoder 3 | from .sparse_unet import SparseUNet 4 | 5 | __all__ = ['PointPillarsScatter', 'SparseEncoder', 'SparseUNet'] 6 | -------------------------------------------------------------------------------- /mmdet3d/models/model_utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .transformer import GroupFree3DMHA 2 | from .vote_module import VoteModule 3 | 4 | __all__ = ['VoteModule', 'GroupFree3DMHA'] 5 | -------------------------------------------------------------------------------- /mmdet3d/models/necks/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.necks.fpn import FPN 2 | from .imvoxel_neck import OutdoorImVoxelNeck 3 | from .second_fpn import SECONDFPN 4 | 5 | __all__ = ['FPN', 'SECONDFPN', 'OutdoorImVoxelNeck'] 6 | -------------------------------------------------------------------------------- /mmdet3d/models/roi_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .base_3droi_head import Base3DRoIHead 2 | from .bbox_heads import PartA2BboxHead 3 | from .h3d_roi_head import H3DRoIHead 4 | from .mask_heads import PointwiseSemanticHead, PrimitiveHead 5 | from .part_aggregation_roi_head import PartAggregationROIHead 6 | from .roi_extractors import Single3DRoIAwareExtractor, SingleRoIExtractor 7 | 8 | __all__ = [ 9 | 'Base3DRoIHead', 'PartAggregationROIHead', 'PointwiseSemanticHead', 10 | 'Single3DRoIAwareExtractor', 'PartA2BboxHead', 'SingleRoIExtractor', 11 | 'H3DRoIHead', 'PrimitiveHead' 12 | ] 13 | -------------------------------------------------------------------------------- /mmdet3d/models/roi_heads/bbox_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.roi_heads.bbox_heads import (BBoxHead, ConvFCBBoxHead, 2 | DoubleConvFCBBoxHead, 3 | Shared2FCBBoxHead, 4 | Shared4Conv1FCBBoxHead) 5 | from .h3d_bbox_head import H3DBboxHead 6 | from .parta2_bbox_head import PartA2BboxHead 7 | 8 | __all__ = [ 9 | 'BBoxHead', 'ConvFCBBoxHead', 'Shared2FCBBoxHead', 10 | 'Shared4Conv1FCBBoxHead', 'DoubleConvFCBBoxHead', 'PartA2BboxHead', 11 | 'H3DBboxHead' 12 | ] 13 | -------------------------------------------------------------------------------- /mmdet3d/models/roi_heads/mask_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .pointwise_semantic_head import PointwiseSemanticHead 2 | from .primitive_head import PrimitiveHead 3 | 4 | __all__ = ['PointwiseSemanticHead', 'PrimitiveHead'] 5 | -------------------------------------------------------------------------------- /mmdet3d/models/roi_heads/roi_extractors/__init__.py: -------------------------------------------------------------------------------- 1 | from mmdet.models.roi_heads.roi_extractors import SingleRoIExtractor 2 | from .single_roiaware_extractor import Single3DRoIAwareExtractor 3 | 4 | __all__ = ['SingleRoIExtractor', 'Single3DRoIAwareExtractor'] 5 | -------------------------------------------------------------------------------- /mmdet3d/models/segmentors/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import Base3DSegmentor 2 | from .encoder_decoder import EncoderDecoder3D 3 | 4 | __all__ = ['Base3DSegmentor', 'EncoderDecoder3D'] 5 | -------------------------------------------------------------------------------- /mmdet3d/models/ssl_modules/__init__.py: -------------------------------------------------------------------------------- 1 | """Overall goal of how SSL Modules are organized. 2 | These modules can be organized into two main groups - processors & consumers. 3 | This has nothing to do with semaphores, but I couldn't think of a 4 | good name. 5 | Processors include: 6 | Taking input data & generating predictions on them. 7 | Can also store intermediates for faster repeated loss calculation. 8 | Processing existing elements of batch_dict and applying nms, etc on them. 9 | Consumers include: 10 | Take existing elements of batch_dict & compute loss on them. 11 | Can be supervised loss or ssl consistency. 12 | Metrics/Debugging. 13 | Separation/relationship between the two: 14 | Processing should be kept away from consumers as much as possible. 15 | NMS should be done by aprocessor. 16 | Unless generally applicable (such as saving intermediates or undoing 17 | augmentations), processors in initialization should take as argument 18 | a "key" to which to save the results of the processing. Consumers 19 | should also take as arugment a key to use. 20 | """ 21 | 22 | from .consumers import * # noqa: F401,F403 23 | from .processors import * # noqa: F401,F403 -------------------------------------------------------------------------------- /mmdet3d/models/ssl_modules/consumers/__init__.py: -------------------------------------------------------------------------------- 1 | from .consumers_2d import HardPseudoLabel_2D, TwoStageSupervised_2D 2 | from .consumers_3d import * 3 | from .metrics import NumPreds 4 | from .openpcdet import (Opd_SimpleTest_3D, Opd_HardPseudoLabel_3D, Opd_Supervised_3D) 5 | from .visualize import Vis3D 6 | -------------------------------------------------------------------------------- /mmdet3d/models/ssl_modules/consumers/metrics.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from collections import defaultdict 3 | 4 | # from mmdet.core.bbox.iou_calculators import bbox_overlaps 5 | from ...builder import SSL_MODULES 6 | from ..utils import mlvl_get 7 | 8 | 9 | @SSL_MODULES.register_module 10 | class NumPreds(): 11 | 12 | def __init__(self, bboxes_key, out_name): 13 | self.bboxes_key = bboxes_key 14 | self.out_name = out_name 15 | 16 | def forward(self, ssl_obj, batch_dict): 17 | bboxes = mlvl_get(batch_dict, self.bboxes_key) 18 | 19 | num = sum([s[0].shape[0] if isinstance(s, tuple) 20 | else s.shape[0] for s in bboxes]) / len(bboxes) 21 | batch_dict['ssl_losses']['metrics.' + self.out_name] = \ 22 | torch.tensor(num, device=bboxes[0][0].device, dtype=torch.float) 23 | 24 | return batch_dict 25 | -------------------------------------------------------------------------------- /mmdet3d/models/ssl_modules/processors/__init__.py: -------------------------------------------------------------------------------- 1 | from .processors_2d import * 2 | from .processors_3d import * 3 | from .processors_fusion import * -------------------------------------------------------------------------------- /mmdet3d/models/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .clip_sigmoid import clip_sigmoid 2 | from .mlp import MLP 3 | 4 | __all__ = ['clip_sigmoid', 'MLP'] 5 | -------------------------------------------------------------------------------- /mmdet3d/models/utils/clip_sigmoid.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | def clip_sigmoid(x, eps=1e-4): 5 | """Sigmoid function for input feature. 6 | 7 | Args: 8 | x (torch.Tensor): Input feature map with the shape of [B, N, H, W]. 9 | eps (float): Lower bound of the range to be clamped to. Defaults 10 | to 1e-4. 11 | 12 | Returns: 13 | torch.Tensor: Feature map after sigmoid. 14 | """ 15 | y = torch.clamp(x.sigmoid_(), min=eps, max=1 - eps) 16 | return y 17 | -------------------------------------------------------------------------------- /mmdet3d/models/voxel_encoders/__init__.py: -------------------------------------------------------------------------------- 1 | from .pillar_encoder import PillarFeatureNet 2 | from .voxel_encoder import DynamicSimpleVFE, DynamicVFE, HardSimpleVFE, HardVFE 3 | 4 | __all__ = [ 5 | 'PillarFeatureNet', 'HardVFE', 'DynamicVFE', 'HardSimpleVFE', 6 | 'DynamicSimpleVFE' 7 | ] 8 | -------------------------------------------------------------------------------- /mmdet3d/ops/ball_query/__init__.py: -------------------------------------------------------------------------------- 1 | from .ball_query import ball_query 2 | 3 | __all__ = ['ball_query'] 4 | -------------------------------------------------------------------------------- /mmdet3d/ops/furthest_point_sample/__init__.py: -------------------------------------------------------------------------------- 1 | from .furthest_point_sample import (furthest_point_sample, 2 | furthest_point_sample_with_dist) 3 | from .points_sampler import Points_Sampler 4 | 5 | __all__ = [ 6 | 'furthest_point_sample', 'furthest_point_sample_with_dist', 7 | 'Points_Sampler' 8 | ] 9 | -------------------------------------------------------------------------------- /mmdet3d/ops/furthest_point_sample/utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | def calc_square_dist(point_feat_a, point_feat_b, norm=True): 5 | """Calculating square distance between a and b. 6 | 7 | Args: 8 | point_feat_a (Tensor): (B, N, C) Feature vector of each point. 9 | point_feat_b (Tensor): (B, M, C) Feature vector of each point. 10 | norm (Bool): Whether to normalize the distance. 11 | Default: True. 12 | 13 | Returns: 14 | Tensor: (B, N, M) Distance between each pair points. 15 | """ 16 | length_a = point_feat_a.shape[1] 17 | length_b = point_feat_b.shape[1] 18 | num_channel = point_feat_a.shape[-1] 19 | # [bs, n, 1] 20 | a_square = torch.sum(point_feat_a.unsqueeze(dim=2).pow(2), dim=-1) 21 | # [bs, 1, m] 22 | b_square = torch.sum(point_feat_b.unsqueeze(dim=1).pow(2), dim=-1) 23 | a_square = a_square.repeat((1, 1, length_b)) # [bs, n, m] 24 | b_square = b_square.repeat((1, length_a, 1)) # [bs, n, m] 25 | 26 | coor = torch.matmul(point_feat_a, point_feat_b.transpose(1, 2)) 27 | 28 | dist = a_square + b_square - 2 * coor 29 | if norm: 30 | dist = torch.sqrt(dist) / num_channel 31 | return dist 32 | -------------------------------------------------------------------------------- /mmdet3d/ops/gather_points/__init__.py: -------------------------------------------------------------------------------- 1 | from .gather_points import gather_points 2 | 3 | __all__ = ['gather_points'] 4 | -------------------------------------------------------------------------------- /mmdet3d/ops/group_points/__init__.py: -------------------------------------------------------------------------------- 1 | from .group_points import GroupAll, QueryAndGroup, grouping_operation 2 | 3 | __all__ = ['QueryAndGroup', 'GroupAll', 'grouping_operation'] 4 | -------------------------------------------------------------------------------- /mmdet3d/ops/interpolate/__init__.py: -------------------------------------------------------------------------------- 1 | from .three_interpolate import three_interpolate 2 | from .three_nn import three_nn 3 | 4 | __all__ = ['three_nn', 'three_interpolate'] 5 | -------------------------------------------------------------------------------- /mmdet3d/ops/iou3d/__init__.py: -------------------------------------------------------------------------------- 1 | from .iou3d_utils import boxes_iou_bev, nms_gpu, nms_normal_gpu 2 | 3 | __all__ = ['boxes_iou_bev', 'nms_gpu', 'nms_normal_gpu'] 4 | -------------------------------------------------------------------------------- /mmdet3d/ops/knn/__init__.py: -------------------------------------------------------------------------------- 1 | from .knn import knn 2 | 3 | __all__ = ['knn'] 4 | -------------------------------------------------------------------------------- /mmdet3d/ops/paconv/__init__.py: -------------------------------------------------------------------------------- 1 | from .assign_score import assign_score_withk 2 | from .paconv import PAConv, PAConvCUDA 3 | 4 | __all__ = ['assign_score_withk', 'PAConv', 'PAConvCUDA'] 5 | -------------------------------------------------------------------------------- /mmdet3d/ops/paconv/src/assign_score_withk.cpp: -------------------------------------------------------------------------------- 1 | // Modified from https://github.com/CVMI-Lab/PAConv/tree/main/scene_seg/lib/paconv_lib/src/gpu 2 | 3 | #include 4 | #include 5 | 6 | void assign_score_withk_forward_wrapper( 7 | int B, int N0, int N1, int M, 8 | int K, int O, int aggregate, 9 | const at::Tensor& points, 10 | const at::Tensor& centers, 11 | const at::Tensor& scores, 12 | const at::Tensor& knn_idx, 13 | at::Tensor& output 14 | ); 15 | 16 | void assign_score_withk_backward_wrapper( 17 | int B, int N0, int N1, int M, 18 | int K, int O, int aggregate, 19 | const at::Tensor& grad_out, 20 | const at::Tensor& points, 21 | const at::Tensor& centers, 22 | const at::Tensor& scores, 23 | const at::Tensor& knn_idx, 24 | at::Tensor& grad_points, 25 | at::Tensor& grad_centers, 26 | at::Tensor& grad_scores 27 | ); 28 | 29 | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { 30 | m.def("assign_score_withk_forward_wrapper", 31 | &assign_score_withk_forward_wrapper, 32 | "Assign score kernel forward (GPU), save memory version"); 33 | m.def("assign_score_withk_backward_wrapper", 34 | &assign_score_withk_backward_wrapper, 35 | "Assign score kernel backward (GPU), save memory version"); 36 | } 37 | -------------------------------------------------------------------------------- /mmdet3d/ops/pointnet_modules/__init__.py: -------------------------------------------------------------------------------- 1 | from .builder import build_sa_module 2 | from .paconv_sa_module import (PAConvCUDASAModule, PAConvCUDASAModuleMSG, 3 | PAConvSAModule, PAConvSAModuleMSG) 4 | from .point_fp_module import PointFPModule 5 | from .point_sa_module import PointSAModule, PointSAModuleMSG 6 | 7 | __all__ = [ 8 | 'build_sa_module', 'PointSAModuleMSG', 'PointSAModule', 'PointFPModule', 9 | 'PAConvSAModule', 'PAConvSAModuleMSG', 'PAConvCUDASAModule', 10 | 'PAConvCUDASAModuleMSG' 11 | ] 12 | -------------------------------------------------------------------------------- /mmdet3d/ops/pointnet_modules/builder.py: -------------------------------------------------------------------------------- 1 | from mmcv.utils import Registry 2 | 3 | SA_MODULES = Registry('point_sa_module') 4 | 5 | 6 | def build_sa_module(cfg, *args, **kwargs): 7 | """Build PointNet2 set abstraction (SA) module. 8 | 9 | Args: 10 | cfg (None or dict): The SA module config, which should contain: 11 | - type (str): Module type. 12 | - module args: Args needed to instantiate an SA module. 13 | args (argument list): Arguments passed to the `__init__` 14 | method of the corresponding module. 15 | kwargs (keyword arguments): Keyword arguments passed to the `__init__` 16 | method of the corresponding SA module . 17 | 18 | Returns: 19 | nn.Module: Created SA module. 20 | """ 21 | if cfg is None: 22 | cfg_ = dict(type='PointSAModule') 23 | else: 24 | if not isinstance(cfg, dict): 25 | raise TypeError('cfg must be a dict') 26 | if 'type' not in cfg: 27 | raise KeyError('the cfg dict must contain the key "type"') 28 | cfg_ = cfg.copy() 29 | 30 | module_type = cfg_.pop('type') 31 | if module_type not in SA_MODULES: 32 | raise KeyError(f'Unrecognized module type {module_type}') 33 | else: 34 | sa_module = SA_MODULES.get(module_type) 35 | 36 | module = sa_module(*args, **kwargs, **cfg_) 37 | 38 | return module 39 | -------------------------------------------------------------------------------- /mmdet3d/ops/roiaware_pool3d/__init__.py: -------------------------------------------------------------------------------- 1 | from .points_in_boxes import (points_in_boxes_batch, points_in_boxes_cpu, 2 | points_in_boxes_gpu) 3 | from .roiaware_pool3d import RoIAwarePool3d 4 | 5 | __all__ = [ 6 | 'RoIAwarePool3d', 'points_in_boxes_gpu', 'points_in_boxes_cpu', 7 | 'points_in_boxes_batch' 8 | ] 9 | -------------------------------------------------------------------------------- /mmdet3d/ops/spconv/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Yan Yan 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from .conv import (SparseConv2d, SparseConv3d, SparseConvTranspose2d, 16 | SparseConvTranspose3d, SparseInverseConv2d, 17 | SparseInverseConv3d, SubMConv2d, SubMConv3d) 18 | from .modules import SparseModule, SparseSequential 19 | from .pool import SparseMaxPool2d, SparseMaxPool3d 20 | from .structure import SparseConvTensor, scatter_nd 21 | 22 | __all__ = [ 23 | 'SparseConv2d', 24 | 'SparseConv3d', 25 | 'SubMConv2d', 26 | 'SubMConv3d', 27 | 'SparseConvTranspose2d', 28 | 'SparseConvTranspose3d', 29 | 'SparseInverseConv2d', 30 | 'SparseInverseConv3d', 31 | 'SparseModule', 32 | 'SparseSequential', 33 | 'SparseMaxPool2d', 34 | 'SparseMaxPool3d', 35 | 'SparseConvTensor', 36 | 'scatter_nd', 37 | ] 38 | -------------------------------------------------------------------------------- /mmdet3d/ops/spconv/include/spconv/mp_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef MP_HELPER_H_ 2 | #define MP_HELPER_H_ 3 | #include 4 | #include 5 | 6 | namespace spconv { 7 | template 8 | struct mp_list {}; 9 | 10 | template 11 | using mp_list_c = mp_list...>; 12 | 13 | namespace detail { 14 | 15 | template 16 | constexpr F mp_for_each_impl(mp_list, F &&f) { 17 | return std::initializer_list{(f(T()), 0)...}, std::forward(f); 18 | } 19 | 20 | template 21 | constexpr F mp_for_each_impl(mp_list<>, F &&f) { 22 | return std::forward(f); 23 | } 24 | 25 | } // namespace detail 26 | 27 | namespace detail { 28 | 29 | template class B> 30 | struct mp_rename_impl { 31 | // An error "no type named 'type'" here means that the first argument to 32 | // mp_rename is not a list 33 | }; 34 | 35 | template