Real-time face recognition by skipping redundant Dlib work
This repo squeezes real-time webcam FPS out of Dlib's heavy face-recognition pipeline by tracking faces between frames instead of re-extracting 128D descriptors every single time.

What it does
This project provides a complete offline face-recognition pipeline built on Dlib. It captures faces through a webcam, extracts 128-dimensional descriptors using a slimmed-down ResNet-34 variant, and stores them in a plain CSV file. At recognition time, it compares incoming faces against the database using Euclidean distance and can display Chinese names via a Tkinter registration GUI.
The interesting bit
The real value is the three-tiered approach to performance. The author profiles the actual bottleneck—compute_face_descriptor takes about 0.158 seconds per face, dragging raw recognition down to roughly 5 FPS—then offers a tracking shortcut. By identifying only on the initial frame and using centroid tracking afterward, the demo jumps from about 20 FPS to 200 FPS on the author’s machine.
Key highlights
- Ships with three recognition strategies: brute-force per-frame, lazy re-recognition for single-face scenes, and a centroid-tracking mode for multi-face scenes
- Uses a ResNet-34 variant with 29 convolutional layers; the README cites 99.38% accuracy on the LFW benchmark at a 0.6 distance threshold
- Supports Chinese names in the Tkinter enrollment GUI, a practical nod to non-English users
- Stores descriptors in a simple
features_all.csvrather than requiring an external database
Caveats
- The 68-point landmark predictor is tuned for Dlib’s HOG detector; the README explicitly warns that it “won’t work as well” with Dlib’s own CNN-based detector because bounding-box alignment differs
- The 20 FPS → 200 FPS speedup figures come from the author’s specific hardware and are not independently verified
- The codebase is a collection of standalone scripts rather than a reusable library, so expect to modify it for integration
Verdict
Worth a look if you need a working, fully local prototype and want to see exactly where face-recognition pipelines choke. Skip it if you need a polished SDK or are already committed to more modern frameworks.
Frequently asked
- What is coneypo/Dlib_face_recognition_from_camera?
- This repo squeezes real-time webcam FPS out of Dlib's heavy face-recognition pipeline by tracking faces between frames instead of re-extracting 128D descriptors every single time.
- Is Dlib_face_recognition_from_camera open source?
- Yes — coneypo/Dlib_face_recognition_from_camera is open source, released under the MIT license.
- What language is Dlib_face_recognition_from_camera written in?
- coneypo/Dlib_face_recognition_from_camera is primarily written in Python.
- How popular is Dlib_face_recognition_from_camera?
- coneypo/Dlib_face_recognition_from_camera has 2.5k stars on GitHub.
- Where can I find Dlib_face_recognition_from_camera?
- coneypo/Dlib_face_recognition_from_camera is on GitHub at https://github.com/coneypo/Dlib_face_recognition_from_camera.