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
yaoyuping
nnDetection
Commits
579f2091
Commit
579f2091
authored
May 15, 2021
by
mibaumgartner
Browse files
bug fix from refactoring
parent
4e420a64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
nndet/core/boxes/ops.py
nndet/core/boxes/ops.py
+4
-4
No files found.
nndet/core/boxes/ops.py
View file @
579f2091
...
@@ -204,10 +204,10 @@ def box_iou_union_2d(boxes1: Tensor, boxes2: Tensor, eps: float = 0) -> Tuple[Te
...
@@ -204,10 +204,10 @@ def box_iou_union_2d(boxes1: Tensor, boxes2: Tensor, eps: float = 0) -> Tuple[Te
area1
=
box_area
(
boxes1
)
area1
=
box_area
(
boxes1
)
area2
=
box_area
(
boxes2
)
area2
=
box_area
(
boxes2
)
x1
=
torch
.
m
in
(
boxes1
[:,
None
,
0
],
boxes2
[:,
0
])
# [N, M]
x1
=
torch
.
m
ax
(
boxes1
[:,
None
,
0
],
boxes2
[:,
0
])
# [N, M]
y1
=
torch
.
m
in
(
boxes1
[:,
None
,
1
],
boxes2
[:,
1
])
# [N, M]
y1
=
torch
.
m
ax
(
boxes1
[:,
None
,
1
],
boxes2
[:,
1
])
# [N, M]
x2
=
torch
.
m
ax
(
boxes1
[:,
None
,
2
],
boxes2
[:,
2
])
# [N, M]
x2
=
torch
.
m
in
(
boxes1
[:,
None
,
2
],
boxes2
[:,
2
])
# [N, M]
y2
=
torch
.
m
ax
(
boxes1
[:,
None
,
3
],
boxes2
[:,
3
])
# [N, M]
y2
=
torch
.
m
in
(
boxes1
[:,
None
,
3
],
boxes2
[:,
3
])
# [N, M]
inter
=
((
x2
-
x1
).
clamp
(
min
=
0
)
*
(
y2
-
y1
).
clamp
(
min
=
0
))
+
eps
# [N, M]
inter
=
((
x2
-
x1
).
clamp
(
min
=
0
)
*
(
y2
-
y1
).
clamp
(
min
=
0
))
+
eps
# [N, M]
union
=
(
area1
[:,
None
]
+
area2
-
inter
)
union
=
(
area1
[:,
None
]
+
area2
-
inter
)
...
...
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