This Python script performs real-time face recognition using OpenCV and the face_recognition library. It captures video from your webcam, detects faces, and compares them with a set of known faces stored in the Resources folder.
- Face Detection: Detects faces in real-time using a webcam.
- Face Recognition: Compares detected faces with a pre-loaded set of known faces.
- Real-time Display: Displays the video feed with bounding boxes and labels for recognized faces.
- Python 3.x
- OpenCV (
cv2) - NumPy (
numpy) - face_recognition library
- Place images of known faces in the
Resourcesfolder. The filename (without extension) will be used as the label for the face. - Run the script:
python face_recognition.py- The script will open a window showing the webcam feed. Recognized faces will be labeled with their corresponding names.
If the Resources folder contains an image named john.jpg, the script will label any detected face that matches John with "JOHN".
- Ensure the face_recognition library is installed and properly configured.
- The script assumes that the Resources folder is in the same directory as the script.