Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Enhance] Replace BEV IoU with 3D IoU #1902

Merged
merged 4 commits into from
May 25, 2022
Merged

Conversation

filaPro
Copy link
Contributor

@filaPro filaPro commented Apr 21, 2022

Motivation

BEV IoU is not needed now in open-mmlab projects after replacing iou3d ops with box_iou_rotated and nms ops. So now we can support fair 3d IoU instead of BEV IoU. This was discussed with @ZwwWayne and @Tai-Wang as a part of work on FCAF3D in mmdetection3d.

Modification

Modify python and cuda functions in mmcv.ops.iou3d to accept not (x1, y1, x2, y2, heading) but (x, y, z, dx, dy, dz, heading) boxes.

BC-breaking (Optional)

It breaks all 3 functions in mmcv.ops.iou3d.

Use cases (Optional)

Fair 3D IoU is a must have function for indoor 3D object detection.

May be @grimoire to have a look on cuda part.

Copy link
Member

@grimoire grimoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhouzaida
Copy link
Collaborator

Please @Tai-Wang have a look

@Tai-Wang
Copy link
Member

Tai-Wang commented Apr 23, 2022

As current mmdetection3d master is using bev iou ops. Have you PR a fix there?

@grimoire A related PR in mmdet3d has been merged into the dev branch and will be merged into master in the next release soon. I have the same concern with you and would prefer to avoiding some potential issues with more safe modifications.

@Tai-Wang
Copy link
Member

Tai-Wang commented Apr 23, 2022

Hi @filaPro , great work! The only concern is that does the current modification remove the original ops directly? If other users use related bev ops in their projects, it will trigger errors? If yes, I think it would be better to keep original ones for several mmcv versions and just throw deprecated warnings to avoid these potential issues.

Besides, if possible, I recommend we can support the bev ops based on these more comprehensive 3D ops. (I think the deprecated bev ops should be just special cases of these 3D ops?)

@filaPro
Copy link
Contributor Author

filaPro commented Apr 23, 2022

Hi @Tai-Wang,

Deprecated functions can be replaced with either box_iou_rotated + nms or novel iou3d ops. We chose the first option in mmdetection3d. But yes, we can probably support the second options here with DeprecationWarning.

@filaPro
Copy link
Contributor Author

filaPro commented Apr 23, 2022

So, I reverted 3 original python functions with minimal changes in code, but with DeprecationWarning. Also, I checked that original 3 tests are also passing now.

mmcv/ops/iou3d.py Outdated Show resolved Hide resolved
mmcv/ops/iou3d.py Outdated Show resolved Hide resolved
@filaPro
Copy link
Contributor Author

filaPro commented May 12, 2022

Hi @ZwwWayne ,

Sorry for late reply. I've update the deprecated bev iou/nms with current mmcv ops (without 3d nms/iou). Also checked that old tests are still passed.

@ZwwWayne ZwwWayne merged commit e9f48a4 into open-mmlab:master May 25, 2022
@filaPro filaPro deleted the iou3d branch May 25, 2022 20:30
wangruohui pushed a commit to wangruohui/mmcv that referenced this pull request Jun 11, 2022
* add iou3d

* revert deprecated python function

* fix lint

* replace 3d iou/nms calls for bev iou/nms
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants