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
c27b1d93
Commit
c27b1d93
authored
6 years ago
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11614 from dkurt:dnn_fix_keras_dilated_conv
parents
8f288173
085be6a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
tf_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
+7
-2
test_tf_importer.cpp
modules/dnn/test/test_tf_importer.cpp
+1
-0
No files found.
modules/dnn/src/tensorflow/tf_importer.cpp
View file @
c27b1d93
...
...
@@ -644,8 +644,9 @@ void TFImporter::populateNet(Net dstNet)
CV_Assert
(
layer
.
input_size
()
==
3
);
DictValue
dilation
=
parseDims
(
getConstBlob
(
layer
,
value_id
,
1
));
CV_Assert
(
dilation
.
size
()
==
2
&&
dilation
.
get
<
int
>
(
0
)
==
dilation
.
get
<
int
>
(
1
));
layerParams
.
set
(
"dilation"
,
dilation
.
get
<
int
>
(
0
));
CV_Assert
(
dilation
.
size
()
==
2
);
layerParams
.
set
(
"dilation_h"
,
dilation
.
get
<
int
>
(
0
));
layerParams
.
set
(
"dilation_w"
,
dilation
.
get
<
int
>
(
1
));
Mat
paddings
;
parseTensor
<
int
>
(
getConstBlob
(
layer
,
value_id
,
2
),
paddings
);
...
...
@@ -655,6 +656,10 @@ void TFImporter::populateNet(Net dstNet)
layerParams
.
set
(
"pad_w"
,
paddings
.
at
<
float
>
(
2
));
StrIntVector
next_layers
=
getNextLayers
(
net
,
name
,
"Conv2D"
);
if
(
next_layers
.
empty
())
{
next_layers
=
getNextLayers
(
net
,
name
,
"DepthwiseConv2dNative"
);
}
CV_Assert
(
next_layers
.
size
()
==
1
);
layer
=
net
.
node
(
next_layers
[
0
].
second
);
layers_to_ignore
.
insert
(
next_layers
[
0
].
first
);
...
...
This diff is collapsed.
Click to expand it.
modules/dnn/test/test_tf_importer.cpp
View file @
c27b1d93
...
...
@@ -124,6 +124,7 @@ TEST_P(Test_TensorFlow_layers, conv)
runTensorFlowNet
(
"atrous_conv2d_valid"
,
targetId
);
runTensorFlowNet
(
"atrous_conv2d_same"
,
targetId
);
runTensorFlowNet
(
"depthwise_conv2d"
,
targetId
);
runTensorFlowNet
(
"keras_atrous_conv2d_same"
,
targetId
);
}
TEST_P
(
Test_TensorFlow_layers
,
padding
)
...
...
This diff is collapsed.
Click to expand it.
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