Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Something wrong in computing 3D IoU #47

Open
yanjh97 opened this issue Mar 22, 2021 · 4 comments
Open

Something wrong in computing 3D IoU #47

yanjh97 opened this issue Mar 22, 2021 · 4 comments

Comments

@yanjh97
Copy link

yanjh97 commented Mar 22, 2021

bbox_1_max = np.amax(bbox_3d_1, axis=0)

Hi, when I debugged method asymmetric_3d_iou(), I found that bbox_3d_1 shape is (3, 8).
Therefore, bbox_1_max shape is (8,), so are bbox_1_min, bbox_2_max, andbbox_2_min.
But I think their shapes should be (3,), which represented bounds of 3D boxes.

@yanjh97 yanjh97 changed the title Something wrong in compute 3D IoU Something wrong in computing 3D IoU Mar 22, 2021
@hughw19
Copy link
Owner

hughw19 commented Mar 23, 2021 via email

@yanjh97
Copy link
Author

yanjh97 commented Mar 23, 2021

Hi, I did a test using method compute_3d_iou_new(). Results are as follows:

from utils import compute_3d_iou_new
import numpy as np
pose = np.eye(4, dtype=np.float32)
pose[:, 3] = np.array([1, 1, 1, 1])
print(compute_3d_iou_new(pose, pose, [1, 1, 1], [0.5, 0.5, 0.5], 1, 'laptop', 'laptop'))
#  def compute_3d_iou_new(RT_1, RT_2, scales_1, scales_2, handle_visibility, class_name_1, class_name_2): ...
  • use bbox_1_max = np.amax(bbox_3d_1, axis=0) which output shape is (8,)
## output : nan
  • use bbox_1_max = np.amax(bbox_3d_1, axis=1) which output shape is (3,)
## output : 0.125

It can be seen that when the output is (3,), the result is correct, but when the output is (8,), the result is strange.

@qq456cvb
Copy link

Hey guys, we've found that this piece of evaluation code is problematic not only because of this bug, but also inaccurate in computing IoU between arbitrary oriented boxes (this code is only accurate when the bounding box is axis aligned). To correct this, we borrow the code from Objectron, and you can find a bug-free version at https://github.com/qq456cvb/CPPF/blob/main/utils/util.py#L186.

@Van5SE
Copy link

Van5SE commented Jul 20, 2023

Dear Author, does this problem means that all the following works calculated the wrong 3D IOU metrics and reported wrong results. Can we fix this problem by simply transpose the bbox_3d ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants