The face_recognition package locates faces, extracts landmarks, and matches identities in images or video. It builds on dlib deep learning models and includes CLI utilities.
Overview
Face Recognition is a Python library and command-line toolkit for finding faces, outlining facial features, and comparing identities across photos. It wraps dlib’s pretrained models and reports strong accuracy on the Labeled Faces in the Wild benchmark cited in project documentation.
From Python you can load an image, enumerate face bounding boxes, fetch eye and mouth landmarks, and test whether unknown faces match labeled examples. Optional deep-learning detection improves localization when CUDA-enabled dlib builds are available.
Installing the package also provides facerecognition and facedetection commands to batch-label folders of images or print coordinates without writing code. Tolerance settings tune how strict comparisons must be when subjects look similar.
The maintainers note platform support on macOS and Linux as primary, with community Windows guides, Docker compositions for deployment, and examples covering webcam streams, video files, and Flask-based HTTP services built by consumers of the library.
Key features
- Face bounding box detection
- Facial landmark localization
- Identity matching against known encodings
- Command-line batch recognition tools
- Adjustable comparison tolerance
- Optional GPU-accelerated detector
- Parallel processing across CPU cores
- Examples for video and web services
Use cases
- Tagging people in photo archives
- Gate access from reference portraits
- Prototyping webcam recognition demos
- Batch auditing unknown event photos