Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
4cbd09c4
Commit
4cbd09c4
authored
Feb 21, 2019
by
Dmitry Kurtaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add extra limitations for LRN from Inference Engine backend
parent
1db5d82b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
lrn_layer.cpp
modules/dnn/src/layers/lrn_layer.cpp
+8
-5
op_inf_engine.cpp
modules/dnn/src/op_inf_engine.cpp
+1
-1
test_halide_layers.cpp
modules/dnn/test/test_halide_layers.cpp
+2
-4
No files found.
modules/dnn/src/layers/lrn_layer.cpp
View file @
4cbd09c4
...
...
@@ -90,9 +90,9 @@ public:
virtual
bool
supportBackend
(
int
backendId
)
CV_OVERRIDE
{
return
backendId
==
DNN_BACKEND_OPENCV
||
backendId
==
DNN_BACKEND_HALIDE
||
backendId
==
DNN_BACKEND_INFERENCE_ENGIN
E
;
if
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
)
return
(
bias
==
1
)
&&
(
preferableTarget
!=
DNN_TARGET_MYRIAD
||
type
==
SPATIAL_NRM
);
return
backendId
==
DNN_BACKEND_OPENCV
||
backendId
==
DNN_BACKEND_HALID
E
;
}
#ifdef HAVE_OPENCL
...
...
@@ -382,10 +382,13 @@ public:
virtual
Ptr
<
BackendNode
>
initInfEngine
(
const
std
::
vector
<
Ptr
<
BackendWrapper
>
>&
)
CV_OVERRIDE
{
#ifdef HAVE_INF_ENGINE
float
alphaSize
=
alpha
;
if
(
!
normBySize
)
alphaSize
*=
(
type
==
SPATIAL_NRM
?
size
*
size
:
size
);
#if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2018R5)
InferenceEngine
::
Builder
::
NormLayer
ieLayer
(
name
);
ieLayer
.
setSize
(
size
);
ieLayer
.
setAlpha
(
alpha
);
ieLayer
.
setAlpha
(
alpha
Size
);
ieLayer
.
setBeta
(
beta
);
ieLayer
.
setAcrossMaps
(
type
==
CHANNEL_NRM
);
...
...
@@ -402,7 +405,7 @@ public:
ieLayer
->
_size
=
size
;
ieLayer
->
_k
=
(
int
)
bias
;
ieLayer
->
_beta
=
beta
;
ieLayer
->
_alpha
=
alpha
;
ieLayer
->
_alpha
=
alpha
Size
;
ieLayer
->
_isAcrossMaps
=
(
type
==
CHANNEL_NRM
);
return
Ptr
<
BackendNode
>
(
new
InfEngineBackendNode
(
ieLayer
));
#endif
...
...
modules/dnn/src/op_inf_engine.cpp
View file @
4cbd09c4
...
...
@@ -227,7 +227,7 @@ void InfEngineBackendNet::addLayer(InferenceEngine::Builder::Layer& layer)
// By default, all the weights are connected to last ports ids.
for
(
int
i
=
0
;
i
<
blobsIds
.
size
();
++
i
)
{
netBuilder
.
connect
((
size_t
)
blobsIds
[
i
],
{(
size_t
)
id
,
portIds
[
i
]});
netBuilder
.
connect
((
size_t
)
blobsIds
[
i
],
{(
size_t
)
id
,
(
size_t
)
portIds
[
i
]});
}
#endif
}
...
...
modules/dnn/test/test_halide_layers.cpp
View file @
4cbd09c4
...
...
@@ -232,8 +232,6 @@ TEST_P(LRN, Accuracy)
std
::
string
nrmType
=
get
<
4
>
(
GetParam
());
Backend
backendId
=
get
<
0
>
(
get
<
5
>
(
GetParam
()));
Target
targetId
=
get
<
1
>
(
get
<
5
>
(
GetParam
()));
if
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
)
throw
SkipTestException
(
""
);
LayerParams
lp
;
lp
.
set
(
"norm_region"
,
nrmType
);
...
...
@@ -254,8 +252,8 @@ INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, LRN, Combine(
/*input ch,w,h*/
Values
(
Vec3i
(
6
,
5
,
8
),
Vec3i
(
7
,
11
,
6
)),
/*local size*/
Values
(
3
,
5
),
Values
(
Vec3f
(
0.9
f
,
1.0
f
,
1.1
f
),
Vec3f
(
0.9
f
,
1.1
f
,
1.0
f
),
/*alpha, beta,
*/
Vec3f
(
1.0
f
,
0.9
f
,
1.1
f
),
Vec3f
(
1.0
f
,
1.1
f
,
0.9
f
),
/*bias */
Vec3f
(
1.1
f
,
0.9
f
,
1.0
f
),
Vec3f
(
1.1
f
,
1.0
f
,
0.9
f
)),
/*alpha, beta,
bias*/
Vec3f
(
1.0
f
,
0.9
f
,
1.1
f
),
Vec3f
(
1.0
f
,
1.1
f
,
0.9
f
),
Vec3f
(
1.1
f
,
0.9
f
,
1.0
f
),
Vec3f
(
1.1
f
,
1.0
f
,
0.9
f
)),
/*norm_by_size*/
Bool
(),
/*norm_type*/
Values
(
"ACROSS_CHANNELS"
,
"WITHIN_CHANNEL"
),
dnnBackendsAndTargetsWithHalide
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment