This project demonstrates real-time face recognition using Python and the face_recognition library. It captures video from the webcam, detects faces, and compares them with known faces to recognize individuals and display their name respectively. The known faces are stored as face encodings, and the face_recognition library is used for face detection and recognition.
- Real-time face recognition using webcam
- Comparison of detected faces with known faces
- Drawing rectangles around detected faces
- Python (>= 3.6)
- OpenCV (cv2)
- face_recognition
- dlib
-
Clone the repository:
git clone https://github.com/BipinNeupane/Face-Detector-AI.git
cd Face-Detector-AI
-
Install the required dependencies:
pip install opencv-python
pip install face-recognition
pip install dlib
-
Run the face recognition script: The script will use your webcam to capture video and perform real-time face recognition. Detected faces will be compared with the known faces in the
images/
directory.
The face recognition script follows these steps:
- Loads the known face images from the
images/
directory. - Captures video from the webcam using OpenCV.
- Detects faces in the video frames using the
face_recognition
library. - Computes face encodings for the detected faces.
- Compares the face encodings of the detected faces with the known face encodings.
- If a match is found, it displays the person's name and draws a rectangle around their face.
- Click a clear image of yourself showing your face
- Give the photo a name (Name of the person who's in the Photo)
- Save it in
images/
folder - Run the program and voila
- The accuracy of face recognition depends on the quality and variety of the known face images.
- Face recognition may be affected by changes in lighting, angle, or facial expressions.
Contributions are welcome! If you find any bugs or have suggestions for improvement, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.