MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / __init__

Method __init__

imutils/face_utils/facealigner.py:9–21  ·  view source on GitHub ↗
(self, predictor, desiredLeftEye=(0.35, 0.35),
		desiredFaceWidth=256, desiredFaceHeight=None)

Source from the content-addressed store, hash-verified

7
8class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected