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
104502c5
Commit
104502c5
authored
Jan 26, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10676 from dkurt:dnn_for_newer_mobilenet_ssd
parents
d1b08486
9e9926a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
prior_box_layer.cpp
modules/dnn/src/layers/prior_box_layer.cpp
+10
-0
tf_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
+10
-16
No files found.
modules/dnn/src/layers/prior_box_layer.cpp
View file @
104502c5
...
...
@@ -416,6 +416,11 @@ public:
{
_boxWidth
=
_widths
[
0
]
*
_scales
[
0
];
_boxHeight
=
_heights
[
0
]
*
_scales
[
0
];
if
(
_bboxesNormalized
)
{
_boxWidth
*=
_imageWidth
;
_boxHeight
*=
_imageHeight
;
}
}
else
_boxWidth
=
_boxHeight
=
_minSize
*
_scales
[
0
];
...
...
@@ -463,6 +468,11 @@ public:
{
_boxWidth
=
_widths
[
i
]
*
_scales
[
i
];
_boxHeight
=
_heights
[
i
]
*
_scales
[
i
];
if
(
_bboxesNormalized
)
{
_boxWidth
*=
_imageWidth
;
_boxHeight
*=
_imageHeight
;
}
for
(
int
j
=
0
;
j
<
_offsetsX
.
size
();
++
j
)
{
float
center_x
=
(
w
+
_offsetsX
[
j
])
*
stepX
;
...
...
modules/dnn/src/tensorflow/tf_importer.cpp
View file @
104502c5
...
...
@@ -1411,23 +1411,17 @@ void TFImporter::populateNet(Net dstNet)
layerParams
.
set
(
"clip"
,
getLayerAttr
(
layer
,
"clip"
).
b
());
if
(
hasLayerAttr
(
layer
,
"offset"
))
layerParams
.
set
(
"offset"
,
getLayerAttr
(
layer
,
"offset"
).
f
());
if
(
hasLayerAttr
(
layer
,
"variance"
))
{
Mat
variance
=
getTensorContent
(
getLayerAttr
(
layer
,
"variance"
).
tensor
());
layerParams
.
set
(
"variance"
,
DictValue
::
arrayReal
<
float
*>
((
float
*
)
variance
.
data
,
variance
.
total
()));
}
if
(
hasLayerAttr
(
layer
,
"aspect_ratio"
))
{
Mat
aspectRatios
=
getTensorContent
(
getLayerAttr
(
layer
,
"aspect_ratio"
).
tensor
());
layerParams
.
set
(
"aspect_ratio"
,
DictValue
::
arrayReal
<
float
*>
((
float
*
)
aspectRatios
.
data
,
aspectRatios
.
total
()));
}
if
(
hasLayerAttr
(
layer
,
"scales"
))
const
std
::
string
paramNames
[]
=
{
"variance"
,
"aspect_ratio"
,
"scales"
,
"width"
,
"height"
};
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
Mat
scales
=
getTensorContent
(
getLayerAttr
(
layer
,
"scales"
).
tensor
());
layerParams
.
set
(
"scales"
,
DictValue
::
arrayReal
<
float
*>
((
float
*
)
scales
.
data
,
scales
.
total
()));
if
(
hasLayerAttr
(
layer
,
paramNames
[
i
]))
{
Mat
values
=
getTensorContent
(
getLayerAttr
(
layer
,
paramNames
[
i
]).
tensor
());
layerParams
.
set
(
paramNames
[
i
],
DictValue
::
arrayReal
<
float
*>
((
float
*
)
values
.
data
,
values
.
total
()));
}
}
int
id
=
dstNet
.
addLayer
(
name
,
"PriorBox"
,
layerParams
);
layer_id
[
name
]
=
id
;
...
...
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