Face detection with cvlib

For the sake of completeness, we are introducing the cvlib package in this section because it also provides an algorithm for face detection. This library is a simple, high-level and easy-to-use open source computer vision library for Python (https://github.com/arunponnusamy/cvlib). In order to detect faces with cvlib, you can use the detect_face() function, which will return the bounding boxes and corresponding confidences for all detected faces:

import cvlib as cv
faces, confidences = cv.detect_face(image)

Under the hood, this function is using the OpenCV DNN face detector with pre-trained Caffe models (https://github.com/arunponnusamy/cvlib/blob/master/cvlib/face_detection.py).

Refer to the face_detection_cvlib_dnn.py script for further details.