A real-time face recognition system that identifies and labels known individuals from a live webcam feed. Built using Python's face_recognition library powered by dlib's deep learning model.
[Live Webcam Feed]
→ Known faces loaded from image dataset
→ Each frame scanned for faces
→ Matched face labeled with name
→ Unknown faces labeled as "Unknown"
- Encoding Known Faces — Loads reference images and computes 128-dimension face encodings
- Live Feed Capture — Streams webcam frames in real-time
- Face Detection — Detects face locations in each frame
- Encoding Comparison — Compares live face encodings against known encodings using Euclidean distance
- Label Display — Draws a bounding box and name label for each matched face
| Tool | Purpose |
|---|---|
| Python 3.x | Core programming language |
| face_recognition | Deep learning-based face encoding & matching |
| OpenCV | Real-time video capture and display |
| dlib | Underlying facial landmark detection |
# Clone the repository
git clone https://github.com/arunkumararavindhakshan05-sudo/Face_recognition.git
cd Face_recognition
# Install dependencies
pip install face_recognition opencv-python
⚠️ Note:face_recognitionrequiresdlibwhich needs CMake. On Windows, install Visual Studio Build Tools before running pip install.
- Add reference images to the
known_faces/folder, named asPersonName.jpg - Run the script:
python face_recognition_live.pyControls:
- Press
Q— Quit the camera feed
Face_recognition/
│
├── known_faces/ # Folder with reference images (Name.jpg)
├── face_recognition_live.py # Main script
└── README.md
- Add a database to store and manage known faces
- Log recognition events with timestamps
- Build a web interface using Flask
- Add anti-spoofing (liveness detection)