Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions configs/pv_rcnn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection

> [PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection](https://arxiv.org/abs/1912.13192)

<!-- [ALGORITHM] -->

## Introduction

3D object detection has been receiving increasing attention from both industry and academia thanks to its wide applications in various fields such as autonomous driving and robotics. LiDAR sensors are widely adopted in autonomous driving vehicles and robots for capturing 3D scene information as sparse and irregular point clouds, which provide vital cues for 3D scene perception and understanding. In this paper, we propose to achieve high performance 3D object detection by designing novel point-voxel integrated networks to learn better 3D features from irregular point clouds.

<div align=center>
<img src="https://user-images.githubusercontent.com/88368822/202114244-ccf52f56-b8c9-4f1b-9cc2-80c7a9952c99.png" width="800"/>
</div>

## Results and models

### KITTI

| Backbone | Class | Lr schd | Mem (GB) | Inf time (fps) | mAP | Download |
| :---------------------------------------------: | :-----: | :--------: | :------: | :------------: | :---: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [SECFPN](./pv_rcnn_8xb2-80e_kitti-3d-3class.py) | 3 Class | cyclic 80e | 5.4 | | 72.28 | [model](https://download.openmmlab.com/mmdetection3d/v1.1.0_models/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class/pv_rcnn_8xb2-80e_kitti-3d-3class_20221117_234428-b384d22f.pth) \\ [log](https://download.openmmlab.com/mmdetection3d/v1.1.0_models/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class/pv_rcnn_8xb2-80e_kitti-3d-3class_20221117_234428.json) |

Note: mAP represents AP11 results on 3 Class under the moderate setting.

Detailed performance on KITTI 3D detection (3D) is as follows, evaluated by AP11 metric:

| | Easy | Moderate | Hard |
| ---------- | :---: | :------: | :---: |
| Car | 89.20 | 83.72 | 78.79 |
| Pedestrian | 66.64 | 59.84 | 55.33 |
| Cyclist | 87.25 | 73.27 | 69.61 |

## Citation

```latex
@article{ShaoshuaiShi2020PVRCNNPF,
title={PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection},
author={Shaoshuai Shi and Chaoxu Guo and Li Jiang and Zhe Wang and Jianping Shi and Xiaogang Wang and Hongsheng Li},
journal={computer vision and pattern recognition},
year={2020}
}
```
29 changes: 29 additions & 0 deletions configs/pv_rcnn/metafile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Collections:
- Name: PV-RCNN
Metadata:
Training Data: KITTI
Training Techniques:
- AdamW
Training Resources: 8x A100 GPUs
Architecture:
- Feature Pyramid Network
Paper:
URL: https://arxiv.org/abs/1912.13192
Title: 'PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection'
README: configs/pv_rcnn/README.md
Code:
URL: https://github.com/open-mmlab/mmdetection3d/blob/dev-1.x/mmdet3d/models/detectors/pv_rcnn.py#L12
Version: v1.1.0rc2

Models:
- Name: pv_rcnn_8xb2-80e_kitti-3d-3class
In Collection: PV_RCNN
Config: configs/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class.py
Metadata:
Training Memory (GB): 5.4
Results:
- Task: 3D Object Detection
Dataset: KITTI
Metrics:
mAP: 72.28
Weights: <https://download.openmmlab.com/mmdetection3d/v1.1.0_models/pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class/pv_rcnn_8xb2-80e_kitti-3d-3class_20221117_234428-b384d22f.pth
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ def forward(self,
'new_xyz: str(new_xyz.shape), new_xyz_batch_cnt: ' \
'str(new_xyz_batch_cnt)'

# idx: (M1 + M2 ..., nsample), empty_ball_mask: (M1 + M2 ...)
idx, empty_ball_mask = ball_query(0, self.radius, self.sample_nums,
xyz, new_xyz, xyz_batch_cnt,
new_xyz_batch_cnt)
# idx: (M1 + M2 ..., nsample)
idx = ball_query(0, self.radius, self.sample_nums, xyz, new_xyz,
xyz_batch_cnt, new_xyz_batch_cnt)
empty_ball_mask = (idx[:, 0] == -1)
idx[empty_ball_mask] = 0
grouped_xyz = grouping_operation(
xyz, idx, xyz_batch_cnt,
new_xyz_batch_cnt) # (M1 + M2, 3, nsample)
Expand Down
14 changes: 7 additions & 7 deletions mmdet3d/models/roi_heads/bbox_heads/pv_rcnn_bbox_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import numpy as np
import torch
from mmcv.cnn import ConvModule
from mmdet.models.task_modules.samplers import SamplingResult
from mmdet.models.utils import multi_apply
from mmengine.model import BaseModule
from mmengine.structures import InstanceData
from torch import nn as nn
Expand All @@ -14,8 +16,6 @@
from mmdet3d.structures.bbox_3d import (LiDARInstance3DBoxes,
rotation_3d_in_axis, xywhr2xyxyr)
from mmdet3d.utils import InstanceList
from mmdet.models.task_modules.samplers import SamplingResult
from mmdet.models.utils import multi_apply


@MODELS.register_module()
Expand Down Expand Up @@ -440,21 +440,21 @@ def get_results(self,
# post processing
result_list = []
for batch_id in range(batch_size):
cls_preds = cls_preds[roi_batch_id == batch_id]
cur_cls_preds = cls_preds[roi_batch_id == batch_id]
box_preds = batch_box_preds[roi_batch_id == batch_id]
label_preds = class_labels[batch_id]

cls_preds = cls_preds.sigmoid()
cls_preds, _ = torch.max(cls_preds, dim=-1)
cur_cls_preds = cur_cls_preds.sigmoid()
cur_cls_preds, _ = torch.max(cur_cls_preds, dim=-1)
selected = self.class_agnostic_nms(
scores=cls_preds,
scores=cur_cls_preds,
bbox_preds=box_preds,
input_meta=input_metas[batch_id],
nms_cfg=test_cfg)

selected_bboxes = box_preds[selected]
selected_label_preds = label_preds[selected]
selected_scores = cls_preds[selected]
selected_scores = cur_cls_preds[selected]

results = InstanceData()
results.bboxes_3d = input_metas[batch_id]['box_type_3d'](
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models/test_detectors/test_pvrcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_pvrcnn(self):
DefaultScope.get_instance('test_pvrcnn', scope_name='mmdet3d')
_setup_seed(0)
pvrcnn_cfg = _get_detector_cfg(
'pvrcnn/pvrcnn_8xb2-80e_kitti-3d-3class.py')
'pv_rcnn/pv_rcnn_8xb2-80e_kitti-3d-3class.py')
model = MODELS.build(pvrcnn_cfg)
num_gt_instance = 2
packed_inputs = _create_detector_inputs(
Expand Down