Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
47a244f6
X
X2Paddle
项目概览
PaddlePaddle
/
X2Paddle
大约 1 年 前同步成功
通知
328
Star
698
Fork
167
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
26
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
X2Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
26
Issue
26
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
47a244f6
编写于
9月 01, 2020
作者:
C
Channingss
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug of multiclass_nms when attr:keep_top_k==-1
上级
2cfdb2c8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
4 deletion
+8
-4
x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/multiclass_nms.py
...paddle2onnx/opset11/paddle_custom_layer/multiclass_nms.py
+4
-2
x2paddle/op_mapper/paddle2onnx/opset9/paddle_custom_layer/multiclass_nms.py
.../paddle2onnx/opset9/paddle_custom_layer/multiclass_nms.py
+4
-2
未找到文件。
x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/multiclass_nms.py
浏览文件 @
47a244f6
...
@@ -72,6 +72,8 @@ def multiclass_nms(op, block):
...
@@ -72,6 +72,8 @@ def multiclass_nms(op, block):
dims
=
(),
dims
=
(),
vals
=
[
float
(
attrs
[
'nms_threshold'
])]))
vals
=
[
float
(
attrs
[
'nms_threshold'
])]))
boxes_num
=
block
.
var
(
outputs
[
'Out'
][
0
]).
shape
[
0
]
top_k_value
=
np
.
int64
(
boxes_num
if
attrs
[
'keep_top_k'
]
==
-
1
else
attrs
[
'keep_top_k'
])
node_keep_top_k
=
onnx
.
helper
.
make_node
(
node_keep_top_k
=
onnx
.
helper
.
make_node
(
'Constant'
,
'Constant'
,
inputs
=
[],
inputs
=
[],
...
@@ -80,7 +82,7 @@ def multiclass_nms(op, block):
...
@@ -80,7 +82,7 @@ def multiclass_nms(op, block):
name
=
name_keep_top_k
[
0
]
+
"@const"
,
name
=
name_keep_top_k
[
0
]
+
"@const"
,
data_type
=
onnx
.
TensorProto
.
INT64
,
data_type
=
onnx
.
TensorProto
.
INT64
,
dims
=
(),
dims
=
(),
vals
=
[
np
.
int64
(
attrs
[
'keep_top_k'
])
]))
vals
=
[
top_k_value
]))
node_keep_top_k_2D
=
onnx
.
helper
.
make_node
(
node_keep_top_k_2D
=
onnx
.
helper
.
make_node
(
'Constant'
,
'Constant'
,
...
@@ -90,7 +92,7 @@ def multiclass_nms(op, block):
...
@@ -90,7 +92,7 @@ def multiclass_nms(op, block):
name
=
name_keep_top_k_2D
[
0
]
+
"@const"
,
name
=
name_keep_top_k_2D
[
0
]
+
"@const"
,
data_type
=
onnx
.
TensorProto
.
INT64
,
data_type
=
onnx
.
TensorProto
.
INT64
,
dims
=
[
1
,
1
],
dims
=
[
1
,
1
],
vals
=
[
np
.
int64
(
attrs
[
'keep_top_k'
])
]))
vals
=
[
top_k_value
]))
# the paddle data format is x1,y1,x2,y2
# the paddle data format is x1,y1,x2,y2
kwargs
=
{
'center_point_box'
:
0
}
kwargs
=
{
'center_point_box'
:
0
}
...
...
x2paddle/op_mapper/paddle2onnx/opset9/paddle_custom_layer/multiclass_nms.py
浏览文件 @
47a244f6
...
@@ -72,6 +72,8 @@ def multiclass_nms(op, block):
...
@@ -72,6 +72,8 @@ def multiclass_nms(op, block):
dims
=
(),
dims
=
(),
vals
=
[
float
(
attrs
[
'nms_threshold'
])]))
vals
=
[
float
(
attrs
[
'nms_threshold'
])]))
boxes_num
=
block
.
var
(
outputs
[
'Out'
][
0
]).
shape
[
0
]
top_k_value
=
np
.
int64
(
boxes_num
if
attrs
[
'keep_top_k'
]
==
-
1
else
attrs
[
'keep_top_k'
])
node_keep_top_k
=
onnx
.
helper
.
make_node
(
node_keep_top_k
=
onnx
.
helper
.
make_node
(
'Constant'
,
'Constant'
,
inputs
=
[],
inputs
=
[],
...
@@ -80,7 +82,7 @@ def multiclass_nms(op, block):
...
@@ -80,7 +82,7 @@ def multiclass_nms(op, block):
name
=
name_keep_top_k
[
0
]
+
"@const"
,
name
=
name_keep_top_k
[
0
]
+
"@const"
,
data_type
=
onnx
.
TensorProto
.
INT64
,
data_type
=
onnx
.
TensorProto
.
INT64
,
dims
=
(),
dims
=
(),
vals
=
[
np
.
int64
(
attrs
[
'keep_top_k'
])
]))
vals
=
[
top_k_value
]))
node_keep_top_k_2D
=
onnx
.
helper
.
make_node
(
node_keep_top_k_2D
=
onnx
.
helper
.
make_node
(
'Constant'
,
'Constant'
,
...
@@ -90,7 +92,7 @@ def multiclass_nms(op, block):
...
@@ -90,7 +92,7 @@ def multiclass_nms(op, block):
name
=
name_keep_top_k_2D
[
0
]
+
"@const"
,
name
=
name_keep_top_k_2D
[
0
]
+
"@const"
,
data_type
=
onnx
.
TensorProto
.
INT64
,
data_type
=
onnx
.
TensorProto
.
INT64
,
dims
=
[
1
,
1
],
dims
=
[
1
,
1
],
vals
=
[
np
.
int64
(
attrs
[
'keep_top_k'
])
]))
vals
=
[
top_k_value
]))
# the paddle data format is x1,y1,x2,y2
# the paddle data format is x1,y1,x2,y2
kwargs
=
{
'center_point_box'
:
0
}
kwargs
=
{
'center_point_box'
:
0
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录