Analysis updated 2026-05-18
Train the recognizer on labeled photos in the train folder and test it against a sample image.
Use the OpenCV-only fallback to learn face detection without compiling native dependencies.
Compare the Haar cascade plus LBPH approach against the more accurate dlib-based face_recognition library.
Adjust the LBPH confidence threshold in main.py to reduce unknown face labels.
| tarikurrahmanbd/face-recognition | a-shojaei/constructdrawingai | alex72-py/aria-termux | |
|---|---|---|---|
| Stars | 20 | 20 | 20 |
| Language | Python | Python | Python |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 4/5 | 2/5 |
| Audience | vibe coder | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
The OpenCV-only fallback needs just opencv-python and numpy, the optional dlib path needs C++ build tools.
This is a simple Python demo for face recognition: it looks at an image, finds faces in it, and tries to match each face to a name it has learned from training pictures. It is meant as a learning example rather than a finished product. The README describes two ways to do the face matching. The main one, and the one actually implemented in main.py, uses OpenCV's Haar cascade to detect faces in an image, paired with a recognizer called LBPH to identify who each face belongs to. This approach only needs the opencv-python and numpy packages and does not require compiling any native code, which makes it easier to get running. The other approach, mentioned as the original idea, uses a library called face_recognition, which depends on a lower-level library called dlib. This second option can be more accurate but needs extra build tools such as Visual Studio's C++ toolchain and CMake on Windows, or a prebuilt version through Anaconda, which makes it more work to set up. To use the project, you put one clear photo of each person into a train folder, naming each file after the person so the filename becomes their label, and place a test photo at test/test.jpg. Running main.py trains the recognizer on the training images and produces an output.jpg file with boxes drawn around detected faces and each one labeled with a name, or as unknown if it cannot find a good match. If too many faces come back labeled unknown, the README suggests adding more training photos per person or adjusting the confidence threshold set inside main.py. The README also lists common problems, like a missing face_recognition module or dlib failing to build, along with fixes for each. The project is released under the MIT license, and the author notes some possible next steps they have not yet built, such as a requirements file or support for multiple training photos per person.
A Python face recognition demo that detects faces with OpenCV Haar cascades and identifies people using an LBPH recognizer trained on labeled photos.
Mainly Python. The stack also includes Python, OpenCV, NumPy.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly vibe coder.
This repo across BitVibe Labs
Verify against the repo before relying on details.