Advanced Face Recognition System is a sophisticated desktop application developed in Python using the Tkinter library and InsightFace for facial recognition. The system offers both real-time and non-real-time face recognition capabilities, with an intuitive user interface and comprehensive user management features.
- Register new users using at least 3 face images
- Automatic face embedding calculation and storage
- Support for multiple face angles and expressions
- Live webcam face detection and recognition
- Real-time identity verification
- Visual feedback with bounding boxes and confidence scores
- Color-coded recognition status (green for known faces, red for unknown)
- Upload and analyze static images
- Support for multiple faces in a single image
- Detailed recognition results with similarity scores
- Visual feedback with highlighted face areas
- View all registered users
- Delete single or multiple users
To run the project, the following libraries are required:
- Python 3.x
- Tkinter (usually comes with Python)
- OpenCV (cv2)
- NumPy
- PIL (Python Imaging Library)
- InsightFace
- scikit-learn
- threading (built-in)
- pickle (built-in)
You can install the required dependencies using pip:
pip install opencv-python numpy pillow insightface scikit-learn
- Clone or download this repository
- Ensure Python 3.x is installed on your system
- Install the required dependencies as described above
- Ensure you have a working webcam for real-time recognition
- Run the application
Run the main file:
python face_recognition_app.py
From the main menu, you can:
- Select at least 3 different face images of the user
- Enter the user's name
- Wait for registration confirmation
- Position face in front of webcam
- View real-time recognition results
- Click "Back to Menu" to exit
- Load an image using "Load Image"
- Click "Verify" to analyze faces
- View recognition results
- View all registered users
- Select users to delete
- Confirm deletions
-
Face Detection
- Uses InsightFace's buffalo_l model
- Detects faces in images or video frames
- Extracts face coordinates
-
Face Embedding
- Generates 512-dimensional face embeddings
- Uses cosine similarity for face matching
- Implements a similarity threshold of 0.6
-
User Registration
- Stores average embeddings from multiple images
- Saves data in a pickle file for persistence
- Validates face presence in registration images
The application stores face embeddings in a local file:
- File name:
embeddings.pkl
- Format: Python pickle format
- Content: Dictionary of user names and face embeddings
- Auto-saves after registration/deletion
Contributions are welcome! Feel free to:
- Open issues for bugs or suggestions
- Submit pull requests with improvements
- Help with documentation
- Share your experience using the system