Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
68ef1d79
Unverified
Commit
68ef1d79
authored
Dec 16, 2022
by
Jingwei Zhang
Committed by
GitHub
Dec 16, 2022
Browse files
[Fix] Fix memory overflow in the rotated box IoU calculation (#2134)
* fix iou3d bug * replace clamp_min with clamp
parent
4e28378d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
mmdet3d/structures/bbox_3d/base_box3d.py
mmdet3d/structures/bbox_3d/base_box3d.py
+9
-3
No files found.
mmdet3d/structures/bbox_3d/base_box3d.py
View file @
68ef1d79
...
@@ -463,11 +463,17 @@ class BaseInstance3DBoxes(object):
...
@@ -463,11 +463,17 @@ class BaseInstance3DBoxes(object):
# height overlap
# height overlap
overlaps_h
=
cls
.
height_overlaps
(
boxes1
,
boxes2
)
overlaps_h
=
cls
.
height_overlaps
(
boxes1
,
boxes2
)
# Restrict the min values of W and H to avoid memory overflow in
# ``box_iou_rotated``.
boxes1_bev
,
boxes2_bev
=
boxes1
.
bev
,
boxes2
.
bev
boxes1_bev
[:,
2
:
4
]
=
boxes1_bev
[:,
2
:
4
].
clamp
(
min
=
1e-4
)
boxes2_bev
[:,
2
:
4
]
=
boxes2
.
bev
[:,
2
:
4
].
clamp
(
min
=
1e-4
)
# bev overlap
# bev overlap
iou2d
=
box_iou_rotated
(
boxes1
.
bev
,
boxes2
.
bev
)
iou2d
=
box_iou_rotated
(
boxes1
_
bev
,
boxes2
_
bev
)
areas1
=
(
boxes1
.
bev
[:,
2
]
*
boxes1
.
bev
[:,
3
]).
unsqueeze
(
1
).
expand
(
areas1
=
(
boxes1
_
bev
[:,
2
]
*
boxes1
_
bev
[:,
3
]).
unsqueeze
(
1
).
expand
(
rows
,
cols
)
rows
,
cols
)
areas2
=
(
boxes2
.
bev
[:,
2
]
*
boxes2
.
bev
[:,
3
]).
unsqueeze
(
0
).
expand
(
areas2
=
(
boxes2
_
bev
[:,
2
]
*
boxes2
_
bev
[:,
3
]).
unsqueeze
(
0
).
expand
(
rows
,
cols
)
rows
,
cols
)
overlaps_bev
=
iou2d
*
(
areas1
+
areas2
)
/
(
1
+
iou2d
)
overlaps_bev
=
iou2d
*
(
areas1
+
areas2
)
/
(
1
+
iou2d
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment