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
001f5faa
Commit
001f5faa
authored
Jun 14, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11763 from dkurt:dnn_keras_relu6_v2
parents
a6ad44a7
693a7663
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
tf_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
+21
-0
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 @
001f5faa
...
...
@@ -1641,6 +1641,27 @@ void TFImporter::populateNet(Net dstNet)
connect
(
layer_id
,
dstNet
,
Pin
(
name
),
flattenId
,
0
);
}
}
else
if
(
type
==
"ClipByValue"
)
{
// op: "ClipByValue"
// input: "input"
// input: "mix"
// input: "max"
CV_Assert
(
layer
.
input_size
()
==
3
);
Mat
minValue
=
getTensorContent
(
getConstBlob
(
layer
,
value_id
,
1
));
Mat
maxValue
=
getTensorContent
(
getConstBlob
(
layer
,
value_id
,
2
));
CV_Assert
(
minValue
.
total
()
==
1
,
minValue
.
type
()
==
CV_32F
,
maxValue
.
total
()
==
1
,
maxValue
.
type
()
==
CV_32F
);
layerParams
.
set
(
"min_value"
,
minValue
.
at
<
float
>
(
0
));
layerParams
.
set
(
"max_value"
,
maxValue
.
at
<
float
>
(
0
));
int
id
=
dstNet
.
addLayer
(
name
,
"ReLU6"
,
layerParams
);
layer_id
[
name
]
=
id
;
connect
(
layer_id
,
dstNet
,
parsePin
(
layer
.
input
(
0
)),
id
,
0
);
}
else
if
(
type
==
"Abs"
||
type
==
"Tanh"
||
type
==
"Sigmoid"
||
type
==
"Relu"
||
type
==
"Elu"
||
type
==
"Identity"
||
type
==
"Relu6"
)
...
...
modules/dnn/test/test_tf_importer.cpp
View file @
001f5faa
...
...
@@ -415,6 +415,7 @@ TEST(Test_TensorFlow, softmax)
TEST
(
Test_TensorFlow
,
relu6
)
{
runTensorFlowNet
(
"keras_relu6"
);
runTensorFlowNet
(
"keras_relu6"
,
DNN_TARGET_CPU
,
/*hasText*/
true
);
}
TEST
(
Test_TensorFlow
,
keras_mobilenet_head
)
...
...
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