Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
97c3bcb1
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
97c3bcb1
编写于
1月 10, 2019
作者:
A
Alexander Nesterov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added fix for other size
上级
dcdbaef3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
16 deletion
+39
-16
modules/dnn/src/dnn.cpp
modules/dnn/src/dnn.cpp
+1
-1
modules/dnn/src/op_inf_engine.cpp
modules/dnn/src/op_inf_engine.cpp
+22
-8
modules/dnn/src/op_inf_engine.hpp
modules/dnn/src/op_inf_engine.hpp
+2
-2
modules/dnn/test/test_layers.cpp
modules/dnn/test/test_layers.cpp
+14
-5
未找到文件。
modules/dnn/src/dnn.cpp
浏览文件 @
97c3bcb1
...
...
@@ -2600,7 +2600,7 @@ Net Net::readFromModelOptimizer(const String& xml, const String& bin)
backendNode
->
net
=
Ptr
<
InfEngineBackendNet
>
(
new
InfEngineBackendNet
(
ieNet
));
for
(
auto
&
it
:
ieNet
.
getOutputsInfo
())
{
Ptr
<
Layer
>
cvLayer
(
new
InfEngineBackendLayer
(
i
t
.
second
));
Ptr
<
Layer
>
cvLayer
(
new
InfEngineBackendLayer
(
i
eNet
));
InferenceEngine
::
CNNLayerPtr
ieLayer
=
ieNet
.
getLayerByName
(
it
.
first
.
c_str
());
CV_Assert
(
ieLayer
);
...
...
modules/dnn/src/op_inf_engine.cpp
浏览文件 @
97c3bcb1
...
...
@@ -718,19 +718,33 @@ Mat infEngineBlobToMat(const InferenceEngine::Blob::Ptr& blob)
return
Mat
(
size
,
CV_32F
,
(
void
*
)
blob
->
buffer
());
}
InfEngineBackendLayer
::
InfEngineBackendLayer
(
const
InferenceEngine
::
DataPtr
&
output_
)
{
output
=
output_
;
}
bool
InfEngineBackendLayer
::
getMemoryShapes
(
const
std
::
vector
<
MatShape
>
&
inputs
,
const
int
requiredOutputs
,
std
::
vector
<
MatShape
>
&
outputs
,
std
::
vector
<
MatShape
>
&
internals
)
const
{
std
::
vector
<
size_t
>
dims
=
output
->
dims
;
std
::
vector
<
int
>
shape
(
dims
.
rbegin
(),
dims
.
rend
());
outputs
.
assign
(
1
,
shape
);
InferenceEngine
::
ICNNNetwork
::
InputShapes
inShapes
=
t_net
.
getInputShapes
();
InferenceEngine
::
ICNNNetwork
::
InputShapes
::
iterator
itr
;
bool
equal_flag
=
true
;
size_t
i
=
0
;
for
(
itr
=
inShapes
.
begin
();
itr
!=
inShapes
.
end
();
++
itr
)
{
InferenceEngine
::
SizeVector
currentInShape
(
inputs
[
i
].
begin
(),
inputs
[
i
].
end
());
if
(
itr
->
second
!=
currentInShape
)
{
itr
->
second
=
currentInShape
;
equal_flag
=
false
;
}
i
++
;
}
if
(
!
equal_flag
)
{
InferenceEngine
::
CNNNetwork
curr_t_net
(
t_net
);
curr_t_net
.
reshape
(
inShapes
);
}
std
::
vector
<
size_t
>
dims
=
t_net
.
getOutputsInfo
()[
name
]
->
getDims
();
outputs
.
push_back
(
MatShape
(
dims
.
begin
(),
dims
.
end
()));
return
false
;
}
...
...
modules/dnn/src/op_inf_engine.hpp
浏览文件 @
97c3bcb1
...
...
@@ -260,7 +260,7 @@ InferenceEngine::TBlob<int16_t>::Ptr convertFp16(const InferenceEngine::Blob::Pt
class
InfEngineBackendLayer
:
public
Layer
{
public:
InfEngineBackendLayer
(
const
InferenceEngine
::
DataPtr
&
output
)
;
InfEngineBackendLayer
(
const
InferenceEngine
::
CNNNetwork
&
t_net_
)
:
t_net
(
t_net_
)
{}
;
virtual
bool
getMemoryShapes
(
const
std
::
vector
<
MatShape
>
&
inputs
,
const
int
requiredOutputs
,
...
...
@@ -273,7 +273,7 @@ public:
virtual
bool
supportBackend
(
int
backendId
)
CV_OVERRIDE
;
private:
InferenceEngine
::
DataPtr
outpu
t
;
InferenceEngine
::
CNNNetwork
t_ne
t
;
};
#endif // HAVE_INF_ENGINE
...
...
modules/dnn/test/test_layers.cpp
浏览文件 @
97c3bcb1
...
...
@@ -1008,8 +1008,8 @@ INSTANTIATE_TEST_CASE_P(/**/, Layer_Test_Convolution_DLDT,
// net.save('/path/to/caffemodel')
//
// 3. Convert using ModelOptimizer.
typedef
testing
::
TestWithParam
<
tuple
<
int
,
int
,
Target
>
>
Test_DLDT_two_inputs
;
TEST_P
(
Test_DLDT_two_inputs
,
as_IR
)
typedef
testing
::
TestWithParam
<
tuple
<
int
,
int
,
Target
,
std
::
vector
<
int
>
>
>
Test_DLDT_two_inputs_3dim
;
TEST_P
(
Test_DLDT_two_inputs
_3dim
,
as_IR
)
{
int
firstInpType
=
get
<
0
>
(
GetParam
());
int
secondInpType
=
get
<
1
>
(
GetParam
());
...
...
@@ -1021,9 +1021,9 @@ TEST_P(Test_DLDT_two_inputs, as_IR)
#endif
Net
net
=
readNet
(
_tf
(
"net_two_inputs.xml"
),
_tf
(
"net_two_inputs.bin"
));
int
inpSize
[]
=
{
1
,
2
,
3
}
;
Mat
firstInp
(
3
,
&
inpSize
[
0
]
,
firstInpType
);
Mat
secondInp
(
3
,
&
inpSize
[
0
]
,
secondInpType
);
std
::
vector
<
int
>
inpSize
=
get
<
3
>
(
GetParam
())
;
Mat
firstInp
(
3
,
inpSize
.
data
()
,
firstInpType
);
Mat
secondInp
(
3
,
inpSize
.
data
()
,
secondInpType
);
randu
(
firstInp
,
0
,
255
);
randu
(
secondInp
,
0
,
255
);
...
...
@@ -1046,6 +1046,15 @@ TEST_P(Test_DLDT_two_inputs, as_IR)
}
}
std
::
vector
<
std
::
vector
<
int
>
>
list_sizes
{
{
1
,
2
,
3
},
{
3
,
2
,
1
},
{
5
,
5
,
5
},
{
13
,
7
,
11
}
};
INSTANTIATE_TEST_CASE_P
(
/*nothing*/
,
Test_DLDT_two_inputs_3dim
,
Combine
(
Values
(
CV_8U
,
CV_32F
),
Values
(
CV_8U
,
CV_32F
),
testing
::
ValuesIn
(
getAvailableTargets
(
DNN_BACKEND_INFERENCE_ENGINE
)),
testing
::
ValuesIn
(
list_sizes
)
));
typedef
testing
::
TestWithParam
<
tuple
<
int
,
int
,
Target
>
>
Test_DLDT_two_inputs
;
TEST_P
(
Test_DLDT_two_inputs
,
as_backend
)
{
static
const
float
kScale
=
0.5
f
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录