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
MMCV
Commits
ac0d8398
Unverified
Commit
ac0d8398
authored
Aug 19, 2021
by
shlrao
Committed by
GitHub
Aug 19, 2021
Browse files
fix nms implentation of cpu (#1244)
parent
9c58d9e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
mmcv/ops/csrc/onnxruntime/cpu/nms.cpp
mmcv/ops/csrc/onnxruntime/cpu/nms.cpp
+1
-1
mmcv/ops/csrc/parrots/nms.cpp
mmcv/ops/csrc/parrots/nms.cpp
+1
-1
mmcv/ops/csrc/pytorch/nms.cpp
mmcv/ops/csrc/pytorch/nms.cpp
+1
-1
No files found.
mmcv/ops/csrc/onnxruntime/cpu/nms.cpp
View file @
ac0d8398
...
...
@@ -88,7 +88,7 @@ void NmsKernel::Compute(OrtKernelContext *context) {
auto
h
=
std
::
max
(
0.
f
,
yy2
-
yy1
+
offset
);
auto
inter
=
w
*
h
;
auto
ovr
=
inter
/
(
iarea
+
areas
[
j
]
-
inter
);
if
(
ovr
>
=
iou_threshold
)
select
[
_j
]
=
false
;
if
(
ovr
>
iou_threshold
)
select
[
_j
]
=
false
;
}
}
std
::
vector
<
int64_t
>
res_order
;
...
...
mmcv/ops/csrc/parrots/nms.cpp
View file @
ac0d8398
...
...
@@ -55,7 +55,7 @@ Tensor nms_cpu(Tensor boxes, Tensor scores, float iou_threshold, int offset) {
auto
h
=
std
::
max
(
0.
f
,
yy2
-
yy1
+
offset
);
auto
inter
=
w
*
h
;
auto
ovr
=
inter
/
(
iarea
+
areas
[
j
]
-
inter
);
if
(
ovr
>
=
iou_threshold
)
select
[
_j
]
=
false
;
if
(
ovr
>
iou_threshold
)
select
[
_j
]
=
false
;
}
}
return
order_t
.
masked_select
(
select_t
);
...
...
mmcv/ops/csrc/pytorch/nms.cpp
View file @
ac0d8398
...
...
@@ -55,7 +55,7 @@ Tensor nms_cpu(Tensor boxes, Tensor scores, float iou_threshold, int offset) {
auto
h
=
std
::
max
(
0.
f
,
yy2
-
yy1
+
offset
);
auto
inter
=
w
*
h
;
auto
ovr
=
inter
/
(
iarea
+
areas
[
j
]
-
inter
);
if
(
ovr
>
=
iou_threshold
)
select
[
_j
]
=
false
;
if
(
ovr
>
iou_threshold
)
select
[
_j
]
=
false
;
}
}
return
order_t
.
masked_select
(
select_t
);
...
...
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