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
39a68897
Commit
39a68897
authored
Jul 25, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15118 from dkurt:fix_15106
parents
0db4fb18
a2125594
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
4 deletions
+27
-4
test_caffe_importer.cpp
modules/dnn/test/test_caffe_importer.cpp
+24
-1
deploy.prototxt
samples/dnn/face_detector/deploy.prototxt
+2
-2
deploy_lowres.prototxt
samples/dnn/face_detector/deploy_lowres.prototxt
+0
-0
js_face_recognition.html
samples/dnn/js_face_recognition.html
+1
-1
No files found.
modules/dnn/test/test_caffe_importer.cpp
View file @
39a68897
...
...
@@ -561,7 +561,7 @@ TEST(Test_Caffe, shared_weights)
typedef
testing
::
TestWithParam
<
tuple
<
std
::
string
,
Target
>
>
opencv_face_detector
;
TEST_P
(
opencv_face_detector
,
Accuracy
)
{
std
::
string
proto
=
findDataFile
(
"dnn/opencv_face_detector.prototxt"
,
false
);
std
::
string
proto
=
findDataFile
(
"dnn/opencv_face_detector.prototxt"
);
std
::
string
model
=
findDataFile
(
get
<
0
>
(
GetParam
()),
false
);
dnn
::
Target
targetId
=
(
dnn
::
Target
)(
int
)
get
<
1
>
(
GetParam
());
...
...
@@ -584,6 +584,29 @@ TEST_P(opencv_face_detector, Accuracy)
0
,
1
,
0.95097077
,
0.51901293
,
0.45863652
,
0.5777427
,
0.5347801
);
normAssertDetections
(
ref
,
out
,
""
,
0.5
,
1e-5
,
2e-4
);
}
// False positives bug for large faces: https://github.com/opencv/opencv/issues/15106
TEST_P
(
opencv_face_detector
,
issue_15106
)
{
std
::
string
proto
=
findDataFile
(
"dnn/opencv_face_detector.prototxt"
);
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
(
"cv/shared/lena.png"
));
img
=
img
.
rowRange
(
img
.
rows
/
4
,
3
*
img
.
rows
/
4
).
colRange
(
img
.
cols
/
4
,
3
*
img
.
cols
/
4
);
Mat
blob
=
blobFromImage
(
img
,
1.0
,
Size
(
300
,
300
),
Scalar
(
104.0
,
177.0
,
123.0
),
false
,
false
);
net
.
setPreferableBackend
(
DNN_BACKEND_OPENCV
);
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]
Mat
out
=
net
.
forward
();
Mat
ref
=
(
Mat_
<
float
>
(
1
,
7
)
<<
0
,
1
,
0.9149431
,
0.30424616
,
0.26964942
,
0.88733053
,
0.99815309
);
normAssertDetections
(
ref
,
out
,
""
,
0.2
,
6e-5
,
1e-4
);
}
INSTANTIATE_TEST_CASE_P
(
Test_Caffe
,
opencv_face_detector
,
Combine
(
Values
(
"dnn/opencv_face_detector.caffemodel"
,
...
...
samples/dnn/face_detector/deploy.prototxt
View file @
39a68897
...
...
@@ -892,7 +892,7 @@ layer {
}
convolution_param {
num_output: 128
pad:
1
pad:
0
kernel_size: 3
stride: 1
weight_filler {
...
...
@@ -958,7 +958,7 @@ layer {
}
convolution_param {
num_output: 128
pad:
1
pad:
0
kernel_size: 3
stride: 1
weight_filler {
...
...
samples/dnn/face_detector/deploy_lowres.prototxt
0 → 100644
View file @
39a68897
This diff is collapsed.
Click to expand it.
samples/dnn/js_face_recognition.html
View file @
39a68897
...
...
@@ -69,7 +69,7 @@ function recognize(face) {
function
loadModels
(
callback
)
{
var
utils
=
new
Utils
(
''
);
var
proto
=
'https://raw.githubusercontent.com/opencv/opencv/3.4/samples/dnn/face_detector/deploy.prototxt'
;
var
proto
=
'https://raw.githubusercontent.com/opencv/opencv/3.4/samples/dnn/face_detector/deploy
_lowres
.prototxt'
;
var
weights
=
'https://raw.githubusercontent.com/opencv/opencv_3rdparty/dnn_samples_face_detector_20180205_fp16/res10_300x300_ssd_iter_140000_fp16.caffemodel'
;
var
recognModel
=
'https://raw.githubusercontent.com/pyannote/pyannote-data/master/openface.nn4.small2.v1.t7'
;
utils
.
createFileFromUrl
(
'face_detector.prototxt'
,
proto
,
()
=>
{
...
...
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