Developer Manual
The setting up of the module can be seen in the User Manual. This page works on the assumption that you have gone through it and have configured the setup.
Enrollment Script
Description
The enrollment script captures facial images from the user using the webcam, extracts facial features, and saves them as templates for authentication.
Usage
Run the enrollment script with the desired username as an argument:
python enroll.py <username>
- The script will capture multiple facial images at 2-second intervals. Ensure that the user looks at the camera during this process.
- After capturing images, facial features will be extracted and saved as templates in the templates directory.
Customization
- You can change the number of images captured during enrollment by modifying the num_images_to_capture variable in the enroll.py script.
- The script saves facial templates in the templates directory. If you want to change the template storage location, modify the template_dir variable in the enroll.py script.
- Apart from this you can even develop a way to enroll already existing images in the system for template formation.
Authentication Script
Description
The authentication script performs real-time face recognition using the webcam and compares facial features with the stored templates to grant or deny access.
Usage
Open the terminal and Run the authentication script:
python authenticate.py
- The script will open the webcam and start real-time face recognition.
- If a recognized face matches a stored template with a distance less than 0.4, access will be granted.
- If not recognized it will redirect you to the password authentication method.
Customization
- The authentication threshold for face recognition is set to 0.4 (face_distance < 0.4). You can adjust this threshold for your specific requirements by modifying the condition in the authenticate.py script.
- Apart from this you can setup a completely different authentication system with different libraries and working model.
PAM Module in C
Description
The PAM module is responsible for integrating the face recognition system with the Ubuntu login process, and also calling the authentication python script and checking the access control status from it.