workflowstacks
ai-agent

Face Recognition with face_recognition

Get simple facial recognition for your startup with face_recognition, used by 57k+ GitHub stars, for Python and command line.
56,653 stars13,694 forksPythonHealth Score 9/10Updated 6/25/2026100% free · open source
What it does

Face_recognition is a Python library that provides simple facial recognition capabilities, allowing you to identify and compare faces in images.

Install / run
pip install face_recognition
When to use it
  • You need to authenticate users based on their facial identity
  • You want to automate the process of tagging people in photos
  • You're building a surveillance system that requires face detection and recognition
Quick start
  1. 1Clone the repository using `git clone https://github.com/ageitgey/face_recognition.git`
  2. 2Navigate to the examples directory using `cd face_recognition/examples`
  3. 3Run the face recognition example using `python face_recognition_example.py`
  4. 4Use the `face_locations` function to detect faces in an image, like this: `face_locations = face_recognition.face_locations(image)`
  5. 5Compare two faces using the `compare_faces` function, like this: `matches = face_recognition.compare_faces([face_encoding], face_encoding_to_check)`
Ready-to-paste prompt
python -m face_recognition `face_recognition examples/obama.jpg examples/biden.jpg -e`
Heads up: Make sure you have the dlib library installed, which is a requirement for face_recognition, and also ensure you're using a compatible version of OpenCV, as face_recognition uses it under the hood
Saves to your device

Topics

face-detection
face-recognition
machine-learning
python
How Face Recognition with face_recognition works
Codeflow
Free to inspect

Face Recognition with face_recognition is a small Python project (~2.7k lines across 28 code files, plus 2 test files). Setup is light: installs like a normal app. Reading the code is optional. Last commit 2 months ago, MIT license, has a test suite.

Size
Small codebase
~2.7k lines · 28 code files · 22 min skim
Setup
One-command install
Installs like a normal app. Reading the code is optional.
Runs on
Python · Docker
No API keys detected
Python 79%Dockerfile 16%Makefile 5%
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    pyproject.toml
    Dependencies and the commands it exposes
  3. 3
    face_recognition/__init__.py
    Inside face_recognition/ — the main logic begins here
  4. 4
    examples/alex-lacamoire.png
    A worked example — copy this to get going
What's in each folder
face_recognition/Core code — the actual logic4 files
examples/Examples you can copy50 files
docs/Documentation12 files
docker/Deployment / infrastructure6 files
tests/Tests — proof it works9 files
.github/CI / automation (GitHub Actions)2 files
READMEHas testsDocumentedCI checksDocker readyExamples includedMIT licenseUpdated 2 mo ago
Quick Actions
Details
Creator
ageitgey
Language
Python
Category
ai-agent
Published
3/3/2017

Are you the creator of this tool? Claim your listing → and earn 85% of every sale.