Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to understand the extract_image_chips? #50

Open
taylover-pei opened this issue May 1, 2019 · 2 comments
Open

How to understand the extract_image_chips? #50

taylover-pei opened this issue May 1, 2019 · 2 comments

Comments

@taylover-pei
Copy link

chips = detector.extract_image_chips(img, points, 144, 0.37)

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
Copy link

nyk510 commented May 7, 2019

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
Copy link

nyk510 commented May 7, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants