video_helper.faces.detect module
video_helper.faces.detect
Per-frame face detection with 5-point landmarks via OpenCV’s YuNet
(cv2.FaceDetectorYN). Tiny, fast, Apache-2.0, HuggingFace-free.
The 5 landmarks (right eye, left eye, nose tip, right mouth corner, left mouth
corner) are what the recognition aligner and the ASD mouth-ROI both need, so the
raw detector row is carried through on each Face for downstream reuse
(cv2.FaceRecognizerSF.alignCrop consumes it directly — no re-derivation).
- class video_helper.faces.detect.Face(box, landmarks, score, raw)[source]
Bases:
objectOne detected face in one frame.
- landmarks
(5, 2)float array — see_LANDMARK_NAMES.- Type:
np.ndarray
- raw
The full 15-float YuNet row (box + 10 landmark coords + score), kept so
cv2.FaceRecognizerSF.alignCropcan be fed the exact detector output.- Type:
np.ndarray
- landmarks: ndarray
- raw: ndarray
- class video_helper.faces.detect.FaceDetector(*, score_threshold=0.6, min_size=40)[source]
Bases:
objectLazy, reusable YuNet detector.
The underlying
cv2.FaceDetectorYNis created on first use and its input size is reset per frame (YuNet requires the exact frame dimensions). Construction never downloads; the firstdetect()does.