Haar Face Detection
The Haar classifier is based on the Haar-like features proposed by Viola and Jones. These features are simple rectangular filters that capture specific patterns in an image, such as edges, lines, and corners. The classifier works by applying a series of these Haar-like features to sub-regions of an image and evaluating the response at each stage to determine the likelihood of a face being present. The Haar classifier consists of a cascade of weak classifiers, which are trained using a variant of the AdaBoost algorithm. Evaluated on Labeled Faces in the Wild (LFW) dataset, the classifier has demonstrated impressive results, achieving accuracies of over 95% with low false-positive rates.
Example
from dronevis.models import HaarFaceDetection
model = HaarFaceDetection() # create model instance
model.load() # load model weights
model.detect_webcam() # run camera detection
Haar Face Detection Class
- class dronevis.models.HaarFaceDetection(min_neighbours=5, min_size=(10, 10), scale_factor=1.1)
Face detection class with Haar Cascades
Paper: Rapid Object Detection using a Boosted Cascade of Simple Features
- __init__(min_neighbours=5, min_size=(10, 10), scale_factor=1.1)
Initialize model instance
- load_model(model_name=None)
Laod model weights
- transform_img(image)
Run image transformation
- predict(image)
Run model inference on the image
- Parameters
image (np.ndarray) – Input image
- Returns
Image withe face annotations
- Return type
np.ndarray