Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
自由之枫~
opencv
提交
9e3ba487
O
opencv
项目概览
自由之枫~
/
opencv
与 Fork 源项目一致
Fork自
OpenCV / opencv
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9e3ba487
编写于
1月 28, 2022
作者:
Z
Zihao Mu
提交者:
GitHub
1月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #21518 from zihaomu:resize_onnx_opset13
Add resize layer compatible with ONNX opset13 version
上级
aee8425b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
3 deletion
+12
-3
modules/dnn/src/graph_simplifier.cpp
modules/dnn/src/graph_simplifier.cpp
+1
-1
modules/dnn/src/onnx/onnx_importer.cpp
modules/dnn/src/onnx/onnx_importer.cpp
+6
-2
modules/dnn/test/test_onnx_importer.cpp
modules/dnn/test/test_onnx_importer.cpp
+5
-0
未找到文件。
modules/dnn/src/graph_simplifier.cpp
浏览文件 @
9e3ba487
...
...
@@ -108,7 +108,7 @@ bool Subgraph::match(const Ptr<ImportGraphWrapper>& net, int nodeId,
for
(
int
j
=
0
;
j
<
inputNodes
.
size
();
++
j
)
{
if
(
nodes
[
inputNodes
[
j
]].
empty
())
// Unknown input node type.
if
(
nodes
[
inputNodes
[
j
]].
empty
()
||
node
->
getInputName
(
j
).
empty
()
)
// Unknown input node type.
continue
;
nodeId
=
getInputNodeId
(
net
,
node
,
j
);
const
Ptr
<
ImportNodeWrapper
>
inpNode
=
net
->
getNode
(
nodeId
);
...
...
modules/dnn/src/onnx/onnx_importer.cpp
浏览文件 @
9e3ba487
...
...
@@ -2781,16 +2781,20 @@ void ONNXImporter::parseResize(LayerParams& layerParams, const opencv_onnx::Node
// opset-10: input = [X, scales]
// opset-11: input = [X, roi, scales] or [x, roi, scales, sizes]
// opset-13: may have empty input, [X, "", "", sizes] or [x, "", scales]
int
scalesInputId
=
node_proto
.
input_size
()
==
2
?
1
:
2
;
const
std
::
string
&
scale_name
=
node_proto
.
input
(
scalesInputId
);
Mat
scales
;
if
(
!
scale_name
.
empty
())
scales
=
getBlob
(
node_proto
,
scalesInputId
);
Mat
scales
=
getBlob
(
node_proto
,
scalesInputId
);
if
(
!
scales
.
empty
())
{
CV_CheckEQ
(
scales
.
total
(),
(
size_t
)
4
,
"HCHW layout is expected"
);
layerParams
.
set
(
"zoom_factor_y"
,
scales
.
at
<
float
>
(
2
));
layerParams
.
set
(
"zoom_factor_x"
,
scales
.
at
<
float
>
(
3
));
}
else
if
(
node_proto
.
input_size
()
>=
4
)
// opset-11
else
if
(
node_proto
.
input_size
()
>=
4
)
// opset-11
[x, roi, scales, sizes] or opset-13: input = [X, "", "", sizes]
{
const
std
::
string
&
inputSizes
=
node_proto
.
input
(
3
);
if
(
constBlobs
.
find
(
inputSizes
)
!=
constBlobs
.
end
())
...
...
modules/dnn/test/test_onnx_importer.cpp
浏览文件 @
9e3ba487
...
...
@@ -885,9 +885,14 @@ TEST_P(Test_ONNX_layers, DynamicResize)
testONNXModels
(
"dynamic_resize_9"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"dynamic_resize_10"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"dynamic_resize_11"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"dynamic_resize_13"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"dynamic_resize_scale_9"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"dynamic_resize_scale_10"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"dynamic_resize_scale_11"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"dynamic_resize_scale_13"
,
npy
,
0
,
0
,
false
,
true
,
2
);
testONNXModels
(
"resize_size_opset11"
);
testONNXModels
(
"resize_size_opset13"
);
}
TEST_P
(
Test_ONNX_layers
,
Resize_HumanSeg
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录