A Python library and command-line tool for face detection, facial landmark identification, and face recognition in images, built on dlib's deep learning models. It accepts image files and returns face locations, facial feature outlines, or identified person names.
Project overview
Lowers the barrier to integrating facial recognition by providing a Python API and command-line tools that wrap dlib's deep learning models, which report 99.38% accuracy on the Labeled Faces in the Wild benchmark.
Project type
Infrastructure
Deployment
Refer to project documentation
License
MIT
Best for
Developers seeking a Python library or command-line tool to detect faces, extract facial landmarks, or identify adults in image files.
Key capabilities
Locates faces in an image and returns their pixel coordinates. Offers an optional, more accurate CNN-based deep learning detection model.
Finds the locations and outlines of each person's eyes, nose, mouth, and chin.
Identifies who appears in a photo by comparing face encodings against a set of known images.
Provides `face_recognition` to identify faces in photographs or folders and `face_detection` to find face locations from the command line.
Enables the manipulation of facial features to apply digital make-up.
Speeds up face recognition by processing images in parallel using multiple CPU cores.
Limitations and risks
Windows is not officially supported.
The face recognition model is trained on adults and does not work very well on children.
Accuracy may vary between ethnic groups.
A bug in the CUDA libraries on the Nvidia Jetson Nano will cause this library to fail silently if specific instructions are not followed.
Getting started
Setup requires medium difficulty because dlib and cmake must be installed separately. The documented first success path is to install dlib from source with Python bindings, install cmake, and then run `pip3 install face_recognition`.
Alternatives and comparisons
A comprehensive computer vision library that provides algorithms for image processing and deep learning, covering broader vision tasks than facial recognition alone.
An open-source tool focused on extracting, training, and swapping faces in images and videos.