(self, predictor, desiredLeftEye=(0.35, 0.35), desiredFaceWidth=256, desiredFaceHeight=None)
| 7 | |
| 8 | class FaceAligner: |
| 9 | def __init__(self, predictor, desiredLeftEye=(0.35, 0.35), |
| 10 | desiredFaceWidth=256, desiredFaceHeight=None): |
| 11 | # store the facial landmark predictor, desired output left |
| 12 | # eye position, and desired output face width + height |
| 13 | self.predictor = predictor |
| 14 | self.desiredLeftEye = desiredLeftEye |
| 15 | self.desiredFaceWidth = desiredFaceWidth |
| 16 | self.desiredFaceHeight = desiredFaceHeight |
| 17 | |
| 18 | # if the desired face height is None, set it to be the |
| 19 | # desired face width (normal behavior) |
| 20 | if self.desiredFaceHeight is None: |
| 21 | self.desiredFaceHeight = self.desiredFaceWidth |
| 22 | |
| 23 | def align(self, image, gray, rect): |
| 24 | # convert the landmark (x, y)-coordinates to a NumPy array |
nothing calls this directly
no outgoing calls
no test coverage detected