A simple face detection and recognition system using InsightFace for accurate face recognition.
- Real-time face detection from webcam
- Face recognition with known faces
- Confidence scores for recognition accuracy
- Simple and lightweight implementation
- Install dependencies:
pip install -r requirements.txt-
Add known faces to the
known_facesdirectory:- Create subdirectories for each person (e.g.,
Mario/,Bastien/, etc.) - Add clear face images (JPG or PNG format) in each person's directory
- Face should be clearly visible and well-lit
- Create subdirectories for each person (e.g.,
-
Run the face detection script:
python simple_face_detection.py- Press 'q' to quit
- Press 's' to save the current frame
- Face Detection: Uses InsightFace for accurate face detection and recognition
- Face Recognition: Extracts face embeddings and compares with known faces
- Real-time Processing: Processes video feed from webcam in real-time
This project is built using InsightFace, a state-of-the-art 2D&3D deep face analysis toolbox. InsightFace provides:
- Advanced face detection algorithms (RetinaFace, SCRFD)
- High-accuracy face recognition with ArcFace
- Face alignment and landmark detection
- Optimized for both training and deployment
InsightFace is an open-source project that efficiently implements various state-of-the-art algorithms for face recognition, face detection, and face alignment, primarily based on PyTorch and MXNet.
face-detection-insightface/
├── simple_face_detection.py # Main face detection script
├── known_faces/ # Directory for known face images
│ ├── Mario/ # Mario's face images
│ ├── Bastien/ # Bastien's face images
│ ├── Freya/ # Freya's face images
│ └── Shane/ # Shane's face images
├── requirements.txt # Python dependencies
└── README.md # This file
- Python 3.8+
- Webcam or video input device
- Clear, well-lit face images for recognition
MIT License

