Merge pull request #14938 from LaurentBerger:face_clip

pull/15195/head
Maksim Shabunin 6 years ago
commit e90438fe3c
  1. 9
      modules/dnn/misc/face_detector_accuracy.py
  2. 4
      modules/dnn/misc/quantize_face_detector.py
  3. 3
      modules/dnn/src/layers/detection_output_layer.cpp
  4. 1
      samples/dnn/face_detector/deploy.prototxt
  5. 10
      samples/dnn/face_detector/opencv_face_detector.pbtxt
  6. 5
      samples/dnn/face_detector/test.prototxt
  7. 4
      samples/dnn/face_detector/train.prototxt

@ -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)

@ -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')

@ -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));
}

@ -1785,5 +1785,6 @@ layer {
code_type: CENTER_SIZE
keep_top_k: 200
confidence_threshold: 0.01
clip: 1
}
}

@ -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"

@ -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 {

@ -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 {

Loading…
Cancel
Save