Skip to content

Commit

Permalink
[Fix] Fix bg point filter (#609)
Browse files Browse the repository at this point in the history
* fix bg_points_filter

* fix 3dssd bg_point_filter bug

* fix bg_filter bug in 3dssd

* update performance

* add model download link
  • Loading branch information
xiliu8006 authored Jun 6, 2021
1 parent fe719e8 commit cde515d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
lr = 0.002 # max learning rate
optimizer = dict(type='AdamW', lr=lr, weight_decay=0)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
lr_config = dict(policy='step', warmup=None, step=[80, 120])
lr_config = dict(policy='step', warmup=None, step=[45, 60])
# runtime settings
runner = dict(type='EpochBasedRunner', max_epochs=150)
runner = dict(type='EpochBasedRunner', max_epochs=80)

# yapf:disable
log_config = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/3dssd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Some settings in our implementation are different from the [official implementat

| Backbone |Class| Lr schd | Mem (GB) | Inf time (fps) | mAP |Download |
| :---------: | :-----: | :------: | :------------: | :----: |:----: | :------: |
| [PointNet2SAMSG](./3dssd_kitti-3d-car.py)| Car |72e|4.7||78.39(81.00)<sup>1</sup>|[model](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/3dssd/3dssd_kitti-3d-car_20210324_122002-07e9a19b.pth) &#124; [log](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/3dssd/3dssd_kitti-3d-car_20210324_122002.log.json)|
| [PointNet2SAMSG](./3dssd_kitti-3d-car.py)| Car |72e|4.7||78.69(81.27)<sup>1</sup>|[model](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/3dssd/3dssd_kitti-3d-car_20210602_124438-b4276f56.pth) &#124; [log](https://download.openmmlab.com/mmdetection3d/v0.1.0_models/3dssd/3dssd_kitti-3d-car_20210602_124438.log.json)|

[1]: We report two different 3D object detection performance here. 78.39mAP is evaluated by our evaluation code and 81.00mAP is evaluated by the official development kit (so as that used in the paper and official code of 3DSSD ). We found that the commonly used Python implementation of [`rotate_iou`](https://github.com/traveller59/second.pytorch/blob/e42e4a0e17262ab7d180ee96a0a36427f2c20a44/second/core/non_max_suppression/nms_gpu.py#L605) which is used in our KITTI dataset evaluation, is different from the official implemention in [KITTI benchmark](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=3d).
[1]: We report two different 3D object detection performance here. 78.69mAP is evaluated by our evaluation code and 81.27mAP is evaluated by the official development kit (so as that used in the paper and official code of 3DSSD ). We found that the commonly used Python implementation of [`rotate_iou`](https://github.com/traveller59/second.pytorch/blob/e42e4a0e17262ab7d180ee96a0a36427f2c20a44/second/core/non_max_suppression/nms_gpu.py#L605) which is used in our KITTI dataset evaluation, is different from the official implemention in [KITTI benchmark](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=3d).
4 changes: 2 additions & 2 deletions configs/3dssd/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Models:
- Task: 3D Object Detection
Dataset: KITTI
Metrics:
mAP: 78.39
Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/3dssd/3dssd_kitti-3d-car_20210324_122002-07e9a19b.pth
mAP: 78.69
Weights: https://download.openmmlab.com/mmdetection3d/v0.1.0_models/3dssd/3dssd_kitti-3d-car_20210602_124438-b4276f56.pth
8 changes: 5 additions & 3 deletions mmdet3d/datasets/pipelines/transforms_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,11 +1129,13 @@ def __call__(self, input_dict):
points = input_dict['points']
gt_bboxes_3d = input_dict['gt_bboxes_3d']

gt_bboxes_3d_np = gt_bboxes_3d.tensor.numpy()
gt_bboxes_3d_np[:, :3] = gt_bboxes_3d.gravity_center.numpy()
# avoid groundtruth being modified
gt_bboxes_3d_np = gt_bboxes_3d.tensor.clone().numpy()
gt_bboxes_3d_np[:, :3] = gt_bboxes_3d.gravity_center.clone().numpy()

enlarged_gt_bboxes_3d = gt_bboxes_3d_np.copy()
enlarged_gt_bboxes_3d[:, 3:6] += self.bbox_enlarge_range
points_numpy = points.tensor.numpy()
points_numpy = points.tensor.clone().numpy()
foreground_masks = box_np_ops.points_in_rbbox(points_numpy,
gt_bboxes_3d_np)
enlarge_foreground_masks = box_np_ops.points_in_rbbox(
Expand Down
2 changes: 1 addition & 1 deletion mmdet3d/models/dense_heads/ssd_3d_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def multiclass_nms_single(self, obj_scores, sem_scores, bbox, points,
bbox.clone(),
box_dim=bbox.shape[-1],
with_yaw=self.bbox_coder.with_rot,
origin=(0.5, 0.5, 1.0))
origin=(0.5, 0.5, 0.5))

if isinstance(bbox, LiDARInstance3DBoxes):
box_idx = bbox.points_in_boxes(points)
Expand Down

0 comments on commit cde515d

Please sign in to comment.