cvlib/cvlib/face_detection.py at master · arunponnusamy/cvlib
face-detectionopencvpythoncvlibsource-code
Abstraction: cvlib Python library face detection module source code
Key points:
detect_face()wraps OpenCV's DNN-based SSD+ResNet face detector in a simple API returning bounding boxes and confidence scores- Uses lazy initialization (global
is_initializedflag) to load Caffe model files only on first call - Model files (
deploy.prototxtandres10_300x300_ssd_iter_140000.caffemodel) are bundled as package data viapkg_resources - Supports optional GPU acceleration via
cv2.dnn.DNN_BACKEND_CUDAandcv2.dnn.DNN_TARGET_CUDA - Confidence threshold defaults to 0.5; returns all faces above threshold as
[startX, startY, endX, endY]lists
Connections: Opencv · Cvlib · Face Detection
Source: https://github.com/arunponnusamy/cvlib/blob/master/cvlib/face_detection.py