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
e8a67de0
Commit
e8a67de0
authored
Mar 30, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11182 from dkurt:fix_11102_part_2
parents
8fce25d7
e039fc3a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
prior_box_layer.cpp
modules/dnn/src/layers/prior_box_layer.cpp
+2
-2
tf_graph_simplifier.cpp
modules/dnn/src/tensorflow/tf_graph_simplifier.cpp
+2
-2
test_layers.cpp
modules/dnn/test/test_layers.cpp
+3
-3
No files found.
modules/dnn/src/layers/prior_box_layer.cpp
View file @
e8a67de0
...
...
@@ -419,8 +419,6 @@ public:
stepY
=
_stepY
;
}
int
_outChannelSize
=
_layerHeight
*
_layerWidth
*
_numPriors
*
4
;
float
*
outputPtr
=
outputs
[
0
].
ptr
<
float
>
();
float
_boxWidth
,
_boxHeight
;
for
(
size_t
h
=
0
;
h
<
_layerHeight
;
++
h
)
...
...
@@ -444,6 +442,8 @@ public:
// clip the prior's coordidate such that it is within [0, 1]
if
(
_clip
)
{
int
_outChannelSize
=
_layerHeight
*
_layerWidth
*
_numPriors
*
4
;
outputPtr
=
outputs
[
0
].
ptr
<
float
>
();
for
(
size_t
d
=
0
;
d
<
_outChannelSize
;
++
d
)
{
outputPtr
[
d
]
=
std
::
min
<
float
>
(
std
::
max
<
float
>
(
outputPtr
[
d
],
0.
),
1.
);
...
...
modules/dnn/src/tensorflow/tf_graph_simplifier.cpp
View file @
e8a67de0
...
...
@@ -219,7 +219,7 @@ public:
Mat
epsMat
=
getTensorContent
(
inputNodes
.
back
()
->
attr
().
at
(
"value"
).
tensor
());
CV_Assert
(
epsMat
.
total
()
==
1
,
epsMat
.
type
()
==
CV_32FC1
);
fusedNode
->
mutable_input
()
->
Re
leas
eLast
();
fusedNode
->
mutable_input
()
->
Re
mov
eLast
();
fusedNode
->
clear_attr
();
tensorflow
::
AttrValue
epsilon
;
epsilon
.
set_f
(
epsMat
.
at
<
float
>
(
0
));
...
...
@@ -254,7 +254,7 @@ public:
Mat
epsMat
=
getTensorContent
(
inputNodes
.
back
()
->
attr
().
at
(
"value"
).
tensor
());
CV_Assert
(
epsMat
.
total
()
==
1
,
epsMat
.
type
()
==
CV_32FC1
);
fusedNode
->
mutable_input
()
->
Re
leas
eLast
();
fusedNode
->
mutable_input
()
->
Re
mov
eLast
();
fusedNode
->
clear_attr
();
tensorflow
::
AttrValue
epsilon
;
epsilon
.
set_f
(
epsMat
.
at
<
float
>
(
0
));
...
...
modules/dnn/test/test_layers.cpp
View file @
e8a67de0
...
...
@@ -842,7 +842,7 @@ TEST(Layer_PriorBox, squares)
LayerParams
lp
;
lp
.
name
=
"testPriorBox"
;
lp
.
type
=
"PriorBox"
;
lp
.
set
(
"min_size"
,
3
2
);
lp
.
set
(
"min_size"
,
2
);
lp
.
set
(
"flip"
,
true
);
lp
.
set
(
"clip"
,
true
);
float
variance
[]
=
{
0.1
f
,
0.1
f
,
0.2
f
,
0.2
f
};
...
...
@@ -858,8 +858,8 @@ TEST(Layer_PriorBox, squares)
net
.
setInput
(
blobFromImage
(
inp
));
Mat
out
=
net
.
forward
();
Mat
target
=
(
Mat_
<
float
>
(
4
,
4
)
<<
-
7.75
f
,
-
15.5
f
,
8.25
f
,
16.5
f
,
-
7.25
f
,
-
15.5
f
,
8.75
f
,
16.5
f
,
Mat
target
=
(
Mat_
<
float
>
(
4
,
4
)
<<
0.0
,
0.0
,
0.75
,
1.0
,
0.25
,
0.0
,
1.0
,
1.0
,
0.1
f
,
0.1
f
,
0.2
f
,
0.2
f
,
0.1
f
,
0.1
f
,
0.2
f
,
0.2
f
);
normAssert
(
out
.
reshape
(
1
,
4
),
target
);
...
...
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