Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
445c74cd
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
445c74cd
编写于
2月 06, 2018
作者:
T
Tao Luo
提交者:
GitHub
2月 06, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8158 from qingqing01/nms_warning_fix
Fix warnings in multiclass_nms_op.cc.
上级
165450ff
e9e24249
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
5 addition
and
5 deletion
+5
-5
paddle/operators/multiclass_nms_op.cc
paddle/operators/multiclass_nms_op.cc
+5
-5
未找到文件。
paddle/operators/multiclass_nms_op.cc
浏览文件 @
445c74cd
...
@@ -85,7 +85,7 @@ static inline void GetMaxScoreIndex(
...
@@ -85,7 +85,7 @@ static inline void GetMaxScoreIndex(
std
::
stable_sort
(
sorted_indices
->
begin
(),
sorted_indices
->
end
(),
std
::
stable_sort
(
sorted_indices
->
begin
(),
sorted_indices
->
end
(),
SortScorePairDescend
<
int
>
);
SortScorePairDescend
<
int
>
);
// Keep top_k scores if needed.
// Keep top_k scores if needed.
if
(
top_k
>
-
1
&&
top_k
<
s
orted_indices
->
size
(
))
{
if
(
top_k
>
-
1
&&
top_k
<
s
tatic_cast
<
int
>
(
sorted_indices
->
size
()
))
{
sorted_indices
->
resize
(
top_k
);
sorted_indices
->
resize
(
top_k
);
}
}
}
}
...
@@ -151,7 +151,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
...
@@ -151,7 +151,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
while
(
sorted_indices
.
size
()
!=
0
)
{
while
(
sorted_indices
.
size
()
!=
0
)
{
const
int
idx
=
sorted_indices
.
front
().
second
;
const
int
idx
=
sorted_indices
.
front
().
second
;
bool
keep
=
true
;
bool
keep
=
true
;
for
(
in
t
k
=
0
;
k
<
selected_indices
->
size
();
++
k
)
{
for
(
size_
t
k
=
0
;
k
<
selected_indices
->
size
();
++
k
)
{
if
(
keep
)
{
if
(
keep
)
{
const
int
kept_idx
=
(
*
selected_indices
)[
k
];
const
int
kept_idx
=
(
*
selected_indices
)[
k
];
T
overlap
=
JaccardOverlap
<
T
>
(
bbox_data
+
idx
*
box_size
,
T
overlap
=
JaccardOverlap
<
T
>
(
bbox_data
+
idx
*
box_size
,
...
@@ -201,7 +201,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
...
@@ -201,7 +201,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
int
label
=
it
.
first
;
int
label
=
it
.
first
;
const
T
*
sdata
=
scores_data
+
label
*
predict_dim
;
const
T
*
sdata
=
scores_data
+
label
*
predict_dim
;
const
std
::
vector
<
int
>&
label_indices
=
it
.
second
;
const
std
::
vector
<
int
>&
label_indices
=
it
.
second
;
for
(
in
t
j
=
0
;
j
<
label_indices
.
size
();
++
j
)
{
for
(
size_
t
j
=
0
;
j
<
label_indices
.
size
();
++
j
)
{
int
idx
=
label_indices
[
j
];
int
idx
=
label_indices
[
j
];
PADDLE_ENFORCE_LT
(
idx
,
predict_dim
);
PADDLE_ENFORCE_LT
(
idx
,
predict_dim
);
score_index_pairs
.
push_back
(
score_index_pairs
.
push_back
(
...
@@ -215,7 +215,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
...
@@ -215,7 +215,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
// Store the new indices.
// Store the new indices.
std
::
map
<
int
,
std
::
vector
<
int
>>
new_indices
;
std
::
map
<
int
,
std
::
vector
<
int
>>
new_indices
;
for
(
in
t
j
=
0
;
j
<
score_index_pairs
.
size
();
++
j
)
{
for
(
size_
t
j
=
0
;
j
<
score_index_pairs
.
size
();
++
j
)
{
int
label
=
score_index_pairs
[
j
].
second
.
first
;
int
label
=
score_index_pairs
[
j
].
second
.
first
;
int
idx
=
score_index_pairs
[
j
].
second
.
second
;
int
idx
=
score_index_pairs
[
j
].
second
.
second
;
new_indices
[
label
].
push_back
(
idx
);
new_indices
[
label
].
push_back
(
idx
);
...
@@ -238,7 +238,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
...
@@ -238,7 +238,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
int
label
=
it
.
first
;
int
label
=
it
.
first
;
const
T
*
sdata
=
scores_data
+
label
*
predict_dim
;
const
T
*
sdata
=
scores_data
+
label
*
predict_dim
;
const
std
::
vector
<
int
>&
indices
=
it
.
second
;
const
std
::
vector
<
int
>&
indices
=
it
.
second
;
for
(
in
t
j
=
0
;
j
<
indices
.
size
();
++
j
)
{
for
(
size_
t
j
=
0
;
j
<
indices
.
size
();
++
j
)
{
int
idx
=
indices
[
j
];
int
idx
=
indices
[
j
];
const
T
*
bdata
=
bboxes_data
+
idx
*
kBBoxSize
;
const
T
*
bdata
=
bboxes_data
+
idx
*
kBBoxSize
;
odata
[
count
*
kOutputDim
]
=
label
;
// label
odata
[
count
*
kOutputDim
]
=
label
;
// label
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录