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
e7d35d51
Commit
e7d35d51
authored
Feb 22, 2018
by
Li Peng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for opencv face detector ocl test
Signed-off-by:
Li Peng
<
peng.li@intel.com
>
parent
c524f669
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
10 deletions
+27
-10
normalize_bbox_layer.cpp
modules/dnn/src/layers/normalize_bbox_layer.cpp
+12
-0
test_backends.cpp
modules/dnn/test/test_backends.cpp
+1
-3
test_caffe_importer.cpp
modules/dnn/test/test_caffe_importer.cpp
+14
-7
No files found.
modules/dnn/src/layers/normalize_bbox_layer.cpp
View file @
e7d35d51
...
...
@@ -105,6 +105,18 @@ public:
float
norm
=
pow
(
absSum
,
1.0
f
/
pnorm
);
multiply
(
src
,
1.0
f
/
norm
,
dst
);
}
else
{
Mat
norm
;
reduce
(
buffer
,
norm
,
0
,
REDUCE_SUM
);
norm
+=
epsilon
;
// compute inverted norm to call multiply instead divide
cv
::
pow
(
norm
,
-
1.0
f
/
pnorm
,
norm
);
repeat
(
norm
,
channels
,
1
,
buffer
);
multiply
(
src
,
buffer
,
dst
);
}
if
(
!
blobs
.
empty
())
{
...
...
modules/dnn/test/test_backends.cpp
View file @
e7d35d51
...
...
@@ -222,9 +222,7 @@ TEST_P(DNNTestNetwork, OpenFace)
TEST_P
(
DNNTestNetwork
,
opencv_face_detector
)
{
if
(
backend
==
DNN_BACKEND_HALIDE
||
backend
==
DNN_BACKEND_DEFAULT
&&
target
==
DNN_TARGET_OPENCL
)
throw
SkipTestException
(
""
);
if
(
backend
==
DNN_BACKEND_HALIDE
)
throw
SkipTestException
(
""
);
Mat
img
=
imread
(
findDataFile
(
"gpu/lbpcascade/er.png"
,
false
));
Mat
inp
=
blobFromImage
(
img
,
1.0
,
Size
(),
Scalar
(
104.0
,
177.0
,
123.0
),
false
,
false
);
processNet
(
"dnn/opencv_face_detector.caffemodel"
,
"dnn/opencv_face_detector.prototxt"
,
...
...
modules/dnn/test/test_caffe_importer.cpp
View file @
e7d35d51
...
...
@@ -456,16 +456,21 @@ TEST(Test_Caffe, multiple_inputs)
normAssert
(
out
,
first_image
+
second_image
);
}
typedef
testing
::
TestWithParam
<
std
::
string
>
opencv_face_detector
;
CV_ENUM
(
DNNTarget
,
DNN_TARGET_CPU
,
DNN_TARGET_OPENCL
)
typedef
testing
::
TestWithParam
<
tuple
<
std
::
string
,
DNNTarget
>
>
opencv_face_detector
;
TEST_P
(
opencv_face_detector
,
Accuracy
)
{
std
::
string
proto
=
findDataFile
(
"dnn/opencv_face_detector.prototxt"
,
false
);
std
::
string
model
=
findDataFile
(
GetParam
(),
false
);
std
::
string
model
=
findDataFile
(
get
<
0
>
(
GetParam
()),
false
);
dnn
::
Target
targetId
=
(
dnn
::
Target
)(
int
)
get
<
1
>
(
GetParam
());
Net
net
=
readNetFromCaffe
(
proto
,
model
);
Mat
img
=
imread
(
findDataFile
(
"gpu/lbpcascade/er.png"
,
false
));
Mat
blob
=
blobFromImage
(
img
,
1.0
,
Size
(),
Scalar
(
104.0
,
177.0
,
123.0
),
false
,
false
);
net
.
setPreferableBackend
(
DNN_BACKEND_DEFAULT
);
net
.
setPreferableTarget
(
targetId
);
net
.
setInput
(
blob
);
// Output has shape 1x1xNx7 where N - number of detections.
// An every detection is a vector of values [id, classId, confidence, left, top, right, bottom]
...
...
@@ -479,11 +484,13 @@ TEST_P(opencv_face_detector, Accuracy)
0.95097077
,
0.51901293
,
0.45863652
,
0.5777427
,
0.5347801
);
normAssert
(
out
.
reshape
(
1
,
out
.
total
()
/
7
).
rowRange
(
0
,
6
).
colRange
(
2
,
7
),
ref
);
}
INSTANTIATE_TEST_CASE_P
(
Test_Caffe
,
opencv_face_detector
,
Values
(
"dnn/opencv_face_detector.caffemodel"
,
"dnn/opencv_face_detector_fp16.caffemodel"
));
INSTANTIATE_TEST_CASE_P
(
Test_Caffe
,
opencv_face_detector
,
Combine
(
Values
(
"dnn/opencv_face_detector.caffemodel"
,
"dnn/opencv_face_detector_fp16.caffemodel"
),
Values
(
DNN_TARGET_CPU
,
DNN_TARGET_OPENCL
)
)
);
TEST
(
Test_Caffe
,
FasterRCNN_and_RFCN
)
{
...
...
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