π·οΈ Face Recognition System using OpenCV & Face_Recognition π Overview This project implements a face recognition system using OpenCV and the face_recognition library. It compares two images to check if they belong to the same person by encoding facial features and calculating similarity scores.
β Key Features:
Detects and recognizes faces in images
Uses HOG-based feature extraction for encoding
Measures similarity using face distance and face matching
Displays bounding boxes around detected faces
Outputs the recognition result and confidence score
π οΈ Tech Stack Python 3.x π
OpenCV (for image processing)
face_recognition (for face encoding & matching)
NumPy (for numerical operations)
π Installation & Setup π§ Prerequisites Make sure you have Python installed. Then, install the required dependencies:
pip install opencv-python pip install face-recognition pip install numpy π₯ Clone the Repository
git clone https://github.com/your-username/Face-Recognition.git cd Face-Recognition π Run the Script python face_recognition.py πΈ How It Works Load & Convert Images: The script loads the images and converts them to RGB format.
Detect & Encode Faces: It detects faces and extracts facial encodings.
Compare Faces: The script compares the test image with the reference image.
Display Results: It shows the images with bounding boxes and prints the recognition result.
π Output Displays the reference image and test image with bounding boxes
Prints match result (True/False) and face distance score
Annotates the test image with the result
Example output:
[True] [0.38] (Lower face distance = better match)
π Future Improvements πΉ Implement live face recognition using webcam πΉ Optimize for multiple face comparisons πΉ Add a database for storing recognized faces
π€ Contributing Contributions are welcome! Feel free to fork, modify, and submit a pull request.
π License This project is open-source and available under the MIT License.
π GitHub: github.com/your-username