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
47c5ee5d
Commit
47c5ee5d
authored
Jul 27, 2019
by
Dmitry Kurtaev
Committed by
LaurentBerger
Jul 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for OpenCV face detection network
parent
97681d06
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
12 deletions
+25
-12
face_detector_accuracy.py
modules/dnn/misc/face_detector_accuracy.py
+7
-2
quantize_face_detector.py
modules/dnn/misc/quantize_face_detector.py
+2
-2
detection_output_layer.cpp
modules/dnn/src/layers/detection_output_layer.cpp
+2
-1
deploy.prototxt
samples/dnn/face_detector/deploy.prototxt
+1
-1
opencv_face_detector.pbtxt
samples/dnn/face_detector/opencv_face_detector.pbtxt
+8
-2
test.prototxt
samples/dnn/face_detector/test.prototxt
+3
-2
train.prototxt
samples/dnn/face_detector/train.prototxt
+2
-2
No files found.
modules/dnn/misc/face_detector_accuracy.py
View file @
47c5ee5d
...
...
@@ -154,8 +154,13 @@ if args.proto and args.model:
top
=
int
(
out
[
0
,
0
,
i
,
4
]
*
img
.
shape
[
0
])
right
=
int
(
out
[
0
,
0
,
i
,
5
]
*
img
.
shape
[
1
])
bottom
=
int
(
out
[
0
,
0
,
i
,
6
]
*
img
.
shape
[
0
])
addDetection
(
detections
,
imageId
,
left
,
top
,
width
=
right
-
left
+
1
,
height
=
bottom
-
top
+
1
,
score
=
confidence
)
x
=
max
(
0
,
min
(
left
,
img
.
shape
[
1
]
-
1
))
y
=
max
(
0
,
min
(
top
,
img
.
shape
[
0
]
-
1
))
w
=
max
(
0
,
min
(
right
-
x
+
1
,
img
.
shape
[
1
]
-
x
))
h
=
max
(
0
,
min
(
bottom
-
y
+
1
,
img
.
shape
[
0
]
-
y
))
addDetection
(
detections
,
imageId
,
x
,
y
,
w
,
h
,
score
=
confidence
)
elif
args
.
cascade
:
cascade
=
cv
.
CascadeClassifier
(
args
.
cascade
)
...
...
modules/dnn/misc/quantize_face_detector.py
View file @
47c5ee5d
...
...
@@ -173,9 +173,9 @@ conv7_2_h = tf.space_to_batch_nd(conv7_1_h, [1, 1], [[1, 1], [1, 1]], name='Pad_
conv7_2_h
=
conv
(
conv7_2_h
,
stride
=
2
,
pad
=
'VALID'
,
name
=
'conv7_2_h'
,
activ
=
tf
.
nn
.
relu
)
conv8_1_h
=
conv
(
conv7_2_h
,
pad
=
'SAME'
,
name
=
'conv8_1_h'
,
activ
=
tf
.
nn
.
relu
)
conv8_2_h
=
conv
(
conv8_1_h
,
pad
=
'
SAME
'
,
name
=
'conv8_2_h'
,
activ
=
tf
.
nn
.
relu
)
conv8_2_h
=
conv
(
conv8_1_h
,
pad
=
'
VALID
'
,
name
=
'conv8_2_h'
,
activ
=
tf
.
nn
.
relu
)
conv9_1_h
=
conv
(
conv8_2_h
,
'conv9_1_h'
,
activ
=
tf
.
nn
.
relu
)
conv9_2_h
=
conv
(
conv9_1_h
,
pad
=
'
SAME
'
,
name
=
'conv9_2_h'
,
activ
=
tf
.
nn
.
relu
)
conv9_2_h
=
conv
(
conv9_1_h
,
pad
=
'
VALID
'
,
name
=
'conv9_2_h'
,
activ
=
tf
.
nn
.
relu
)
conv4_3_norm
=
l2norm
(
layer_256_1_relu1
,
'conv4_3_norm'
)
...
...
modules/dnn/src/layers/detection_output_layer.cpp
View file @
47c5ee5d
...
...
@@ -198,7 +198,7 @@ public:
virtual
bool
supportBackend
(
int
backendId
)
CV_OVERRIDE
{
return
backendId
==
DNN_BACKEND_OPENCV
||
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
&&
!
_locPredTransposed
&&
_bboxesNormalized
&&
!
_clip
);
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
&&
!
_locPredTransposed
&&
_bboxesNormalized
);
}
bool
getMemoryShapes
(
const
std
::
vector
<
MatShape
>
&
inputs
,
...
...
@@ -936,6 +936,7 @@ public:
InferenceEngine
::
Builder
::
Layer
l
=
ieLayer
;
l
.
getParameters
()[
"eta"
]
=
std
::
string
(
"1.0"
);
l
.
getParameters
()[
"clip"
]
=
_clip
;
return
Ptr
<
BackendNode
>
(
new
InfEngineBackendNode
(
l
));
}
...
...
samples/dnn/face_detector/deploy.prototxt
View file @
47c5ee5d
...
...
@@ -1784,7 +1784,7 @@ layer {
}
code_type: CENTER_SIZE
keep_top_k: 200
confidence_threshold: 0.
2
confidence_threshold: 0.
01
clip: 1
}
}
samples/dnn/face_detector/opencv_face_detector.pbtxt
View file @
47c5ee5d
...
...
@@ -1221,7 +1221,7 @@ node {
attr {
key: "padding"
value {
s: "
SAME
"
s: "
VALID
"
}
}
attr {
...
...
@@ -1311,7 +1311,7 @@ node {
attr {
key: "padding"
value {
s: "
SAME
"
s: "
VALID
"
}
}
attr {
...
...
@@ -2337,6 +2337,12 @@ node {
i: 400
}
}
attr {
key: "clip"
value {
b: true
}
}
}
node {
name: "reshape_before_softmax"
...
...
samples/dnn/face_detector/test.prototxt
View file @
47c5ee5d
...
...
@@ -917,7 +917,7 @@ layer {
}
convolution_param {
num_output: 128
pad:
1
pad:
0
kernel_size: 3
stride: 1
weight_filler {
...
...
@@ -983,7 +983,7 @@ layer {
}
convolution_param {
num_output: 128
pad:
1
pad:
0
kernel_size: 3
stride: 1
weight_filler {
...
...
@@ -1810,6 +1810,7 @@ layer {
code_type: CENTER_SIZE
keep_top_k: 200
confidence_threshold: 0.01
clip: 1
}
}
layer {
...
...
samples/dnn/face_detector/train.prototxt
View file @
47c5ee5d
...
...
@@ -1086,7 +1086,7 @@ layer {
}
convolution_param {
num_output: 128
pad:
1
pad:
0
kernel_size: 3
stride: 1
weight_filler {
...
...
@@ -1600,7 +1600,7 @@ layer {
}
convolution_param {
num_output: 16
pad:
1
pad:
0
kernel_size: 3
stride: 1
weight_filler {
...
...
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