Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
fed47521
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fed47521
编写于
8月 08, 2019
作者:
C
channingss
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete op for detection
上级
5d5ed8ae
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
1 addition
and
50 deletion
+1
-50
x2paddle/op_mapper/onnx_op_mapper.py
x2paddle/op_mapper/onnx_op_mapper.py
+1
-50
未找到文件。
x2paddle/op_mapper/onnx_op_mapper.py
浏览文件 @
fed47521
...
...
@@ -359,7 +359,7 @@ class ONNXOpMapper(OpMapper):
inputs
,
outputs
)
shape_dtype
=
_np
.
dtype
(
'int32'
)
if
shape
is
None
:
shape
=
[
1
,
-
1
]
# who knows
shape
=
[
1
,
-
1
]
_logger
.
warning
(
'in %s(%s -> Reshape -> %s): '
'input "shape" not inferred, use [1, -1] as dummy value, '
...
...
@@ -419,55 +419,6 @@ class ONNXOpMapper(OpMapper):
output
=
node
,
param_attr
=
attr
)
def
_roi_pool
(
self
,
node
,
fluid_op
=
None
):
val_x
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
],
copy
=
True
)
val_rois
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
],
copy
=
True
)
val_y
=
self
.
graph
.
get_node
(
node
.
layer
.
output
[
0
],
copy
=
True
)
spatial_scale
=
node
.
get_attr
(
'spatial_scale'
)
# required
pooled_height
,
pooled_width
=
node
.
get_attr
(
'pooled_shape'
)
# required
attr
=
{
'pooled_height'
:
pooled_height
,
'spatial_scale'
:
spatial_scale
}
feature_attr
=
''
is_max_pool
=
fluid_op
==
'roi_pool'
if
'sampling_ratio'
in
node
.
attr_map
:
#
sampling_ratio
=
node
.
get_attr
[
'sampling_ratio'
]
attr
[
'sampling_ratio'
]
=
sampling_ratio
if
'output_channels'
in
node
.
attr_map
:
#
output_channels
=
node
.
get_attr
[
'output_channels'
]
attr
[
'output_channels'
]
=
output_channels
node
.
fluid_code
.
add_layer
(
fluid_op
,
inputs
=
','
.
join
([
valx
,
val_rois
]),
output
=
node
,
param_attr
=
attr
)
def
RoiAlign
(
self
,
node
):
self
.
_roi_pool
(
node
,
fluid_op
=
'roi_align'
)
def
NonMaxSuppression
(
self
,
node
):
(
val_boxes
,
val_scores
,
val_max_output_boxes_per_class
,
val_iou_threshold
,
val_score_threshold
)
=
self
.
graph
.
get_nodes
(
node
.
layer
.
input
,
copy
=
True
)
center_point_box
=
node
.
get_attr
(
'center_point_box'
,
0
)
scores
=
_const_weight_or_none
(
val_scores
)
max_output_boxes_per_class
=
_const_weight_or_none
(
val_max_output_boxes_per_class
)
iou_threshold
=
_const_weight_or_none
(
val_iou_threshold
)
score_threshold
=
_const_weight_or_none
(
val_score_threshold
)
if
center_point_box
==
1
:
pass
attr
=
{
'scores'
:
scores
,
'score_threshold'
:
score_threshold
,
'nms_threshold'
:
iou_threshold
,
'nms_top_k'
:
max_output_boxes_per_class
,
}
def
Concat
(
self
,
node
):
inputs
=
[]
for
i
in
range
(
len
(
node
.
layer
.
input
)):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录