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
a33d5008
Commit
a33d5008
authored
Jan 10, 2020
by
Liubov Batanina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add global_pooling_dim flags
parent
7eba3a7c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
13 deletions
+7
-13
layers_common.cpp
modules/dnn/src/layers/layers_common.cpp
+6
-12
tf_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
+1
-1
No files found.
modules/dnn/src/layers/layers_common.cpp
View file @
a33d5008
...
...
@@ -150,18 +150,12 @@ void getPoolingKernelParams(const LayerParams ¶ms, std::vector<size_t>& kern
{
bool
is_global
=
params
.
get
<
bool
>
(
"global_pooling"
,
false
);
globalPooling
=
std
::
vector
<
bool
>
(
3
,
is_global
);
if
(
params
.
has
(
"global_d"
))
{
globalPooling
[
0
]
=
params
.
get
<
bool
>
(
"global_d"
);
}
else
if
(
params
.
has
(
"global_h"
))
{
globalPooling
[
1
]
=
params
.
get
<
bool
>
(
"global_h"
);
}
else
if
(
params
.
has
(
"global_w"
))
{
globalPooling
[
2
]
=
params
.
get
<
bool
>
(
"global_w"
);
}
if
(
params
.
has
(
"global_pooling_d"
))
globalPooling
[
0
]
=
params
.
get
<
bool
>
(
"global_pooling_d"
);
else
if
(
params
.
has
(
"global_pooling_h"
))
globalPooling
[
1
]
=
params
.
get
<
bool
>
(
"global_pooling_h"
);
else
if
(
params
.
has
(
"global_pooling_w"
))
globalPooling
[
2
]
=
params
.
get
<
bool
>
(
"global_pooling_w"
);
if
(
is_global
)
{
...
...
modules/dnn/src/tensorflow/tf_importer.cpp
View file @
a33d5008
...
...
@@ -1961,7 +1961,7 @@ void TFImporter::populateNet(Net dstNet)
CV_Assert
(
layer_id
.
find
(
avgName
)
==
layer_id
.
end
());
avgLp
.
set
(
"pool"
,
"ave"
);
// pooling kernel H x 1
avgLp
.
set
(
"global_h"
,
true
);
avgLp
.
set
(
"global_
pooling_
h"
,
true
);
avgLp
.
set
(
"kernel_size"
,
1
);
int
avgId
=
dstNet
.
addLayer
(
avgName
,
"Pooling"
,
avgLp
);
layer_id
[
avgName
]
=
avgId
;
...
...
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