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
9d91c635
Commit
9d91c635
authored
May 31, 2018
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11635 from dkurt:dnn_fix_ie_fused_layer_output
parents
49321a23
32bab45f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
dnn.cpp
modules/dnn/src/dnn.cpp
+1
-1
test_layers.cpp
modules/dnn/test/test_layers.cpp
+53
-0
No files found.
modules/dnn/src/dnn.cpp
View file @
9d91c635
...
...
@@ -1132,7 +1132,7 @@ struct Net::Impl
if
(
layerNet
!=
ieInpNode
->
net
)
{
// layerNet is empty or nodes are from different graphs.
ieInpNode
->
net
->
addOutput
(
i
npLd
.
name
);
ieInpNode
->
net
->
addOutput
(
i
eInpNode
->
layer
->
name
);
}
}
}
...
...
modules/dnn/test/test_layers.cpp
View file @
9d91c635
...
...
@@ -834,6 +834,59 @@ TEST(Test_DLDT, two_inputs)
normAssert
(
out
,
firstInp
+
secondInp
);
}
class
UnsupportedLayer
:
public
Layer
{
public
:
UnsupportedLayer
(
const
LayerParams
&
params
)
{}
static
Ptr
<
Layer
>
create
(
const
LayerParams
&
params
)
{
return
Ptr
<
Layer
>
(
new
UnsupportedLayer
(
params
));
}
virtual
bool
supportBackend
(
int
backendId
)
CV_OVERRIDE
{
return
backendId
==
DNN_BACKEND_DEFAULT
;
}
virtual
void
forward
(
std
::
vector
<
cv
::
Mat
*>
&
inputs
,
std
::
vector
<
cv
::
Mat
>
&
outputs
,
std
::
vector
<
cv
::
Mat
>
&
internals
)
CV_OVERRIDE
{}
virtual
void
forward
(
cv
::
InputArrayOfArrays
inputs
,
cv
::
OutputArrayOfArrays
outputs
,
cv
::
OutputArrayOfArrays
internals
)
CV_OVERRIDE
{}
};
TEST
(
Test_DLDT
,
fused_output
)
{
static
const
int
kNumChannels
=
3
;
CV_DNN_REGISTER_LAYER_CLASS
(
Unsupported
,
UnsupportedLayer
);
Net
net
;
{
LayerParams
lp
;
lp
.
set
(
"kernel_size"
,
1
);
lp
.
set
(
"num_output"
,
3
);
lp
.
set
(
"bias_term"
,
false
);
lp
.
type
=
"Convolution"
;
lp
.
name
=
"testConv"
;
lp
.
blobs
.
push_back
(
Mat
({
kNumChannels
,
1
,
1
,
1
},
CV_32F
,
Scalar
(
1
)));
net
.
addLayerToPrev
(
lp
.
name
,
lp
.
type
,
lp
);
}
{
LayerParams
lp
;
lp
.
set
(
"bias_term"
,
false
);
lp
.
type
=
"Scale"
;
lp
.
name
=
"testScale"
;
lp
.
blobs
.
push_back
(
Mat
({
kNumChannels
},
CV_32F
,
Scalar
(
1
)));
net
.
addLayerToPrev
(
lp
.
name
,
lp
.
type
,
lp
);
}
{
LayerParams
lp
;
net
.
addLayerToPrev
(
"unsupported_layer"
,
"Unsupported"
,
lp
);
}
net
.
setPreferableBackend
(
DNN_BACKEND_INFERENCE_ENGINE
);
net
.
setInput
(
Mat
({
1
,
1
,
1
,
1
},
CV_32FC1
,
Scalar
(
1
)));
ASSERT_NO_THROW
(
net
.
forward
());
LayerFactory
::
unregisterLayer
(
"Unsupported"
);
}
#endif // HAVE_INF_ENGINE
// Test a custom layer.
...
...
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