How to understand the extract_image_chips?
taylover-pei opened this issue · 2 comments
taylover-pei commented
mxnet_mtcnn_face_detection/main.py
Line 22 in b560654
How to understand the parameters 0.37? If I want to crop the face in multi scales, such as 0.9, 1.0, 1,1...... How can I control the parameter?
Looking forward to your reply!
nyk510 commented
Hi! taylover-pei San!
The parameter 0.37 means that cut out detected image by leaving its height (or width) times the padding
.
The code to do it is as follows
for i in range(len(shape) // 2):
x = (padding + mean_face_shape_x[i]) / (2 * padding + 1) * desired_size
y = (padding + mean_face_shape_y[i]) / (2 * padding + 1) * desired_size
nyk510 commented
If you change the scale of detector, change scale
in first stage detection.
In the mtcnn_detector
, run detection by the scales values.
for scale in scales:
return_boxes = detect_first_stage(img, self.PNets[0], scale, self.threshold[0])
so you should change the calculation method to a good feeling ;)