Face Enrollment
How to enroll faces into the recognition database
Face enrollment is the process of adding persons to the recognition database using folder-based batch enrollment.
Prerequisites
Before enrolling faces, ensure you have:
- InsightFace library installed with dependencies
- buffalo_l model (downloads automatically on first run)
Folder-Based Enrollment
Organize person images in folders named by person for batch enrollment.
Folder Structure
Create a folder for each person, with the folder name as the person's identifier:
| Folder | Contents |
|---|---|
| Person_Name_1/ | Multiple images of person 1 |
| Person_Name_2/ | Multiple images of person 2 |
| Person_Name_3/ | Multiple images of person 3 |
Image Requirements
| Factor | Recommendation |
|---|---|
| Count | 3-5 images per person |
| Formats | JPG, JPEG, PNG, BMP, WEBP |
| Resolution | At least 640x480 |
| Face Size | Face should be >= 100 pixels |
| Lighting | Even, front-facing light |
| Expression | Neutral or slight smile |
| Angle | Include varied angles (front, slight turn) |
How Enrollment Works
1. Image Loading
The system scans the enrollment folder and loads all images from each person's subfolder.
2. Face Detection
For each image, the system detects faces using SCRFD.
Quality checks:
- Face size must be >= 50 pixels
- Detection confidence >= 0.5
- Only one face per image (or largest is used)
3. Embedding Extraction
Each face is converted to a 512-dimensional embedding vector using ArcFace.
4. Embedding Averaging
Multiple samples are averaged for robust recognition. This averaging reduces the impact of:
- Lighting variations
- Different angles
- Expression changes
5. Database Storage
The normalized, averaged embedding is saved to the face database for recognition.
Best Practices
Sample Count
| Count | Reliability |
|---|---|
| 1 image | Less reliable |
| 3-5 images | Recommended |
| 10+ images | High-accuracy requirements |
Naming Conventions
- Use underscores for spaces (e.g.,
John_Doe) - Be consistent with naming
- Avoid special characters
- Names are case-sensitive
Image Tips
- Use photos with only the target person
- Ensure face is clearly visible
- Avoid photos that are too dark or bright
- Face should be in focus, not blurry
Troubleshooting
No face detected
Solutions:
- Ensure face is clearly visible
- Check image isn't too dark/bright
- Face may be too small - use closer photo
- Image may be corrupted - try another
Multiple faces detected
Solutions:
- Use photos with only the target person
- Crop images to single person
- System uses largest face if multiple detected
Low quality warning
Solutions:
- Use higher resolution images
- Ensure proper lighting
- Reduce motion blur
- Face should be clearly in focus
Database Management
| Operation | Description |
|---|---|
| View enrolled | List all persons in database |
| Remove person | Delete from database |
| Re-enroll | Run enrollment again to update embeddings |
.png)