The company is hosting a significant event and has tasked its two leading artificial intelligence (AI) experts with developing a facial recognition system using Computer Vision. The objective is to streamline the event entry process by eliminating the need for ticket verification and ID checks. The proposal involves employees approaching a laptop, where an AI-based system will recognize their faces in real-time, granting or denying access.
The request entails implementing a machine learning system that, through a camera, can determine whether the person in front of the device is an employee or not. It is crucial to note that external data is not available, requiring the AI experts to generate the necessary dataset. Before deploying the system in production, a test is required to ensure accurate recognition of team members (developers). It is worth mentioning that both the model and the data must run on a laptop, and the use of cloud services is not allowed due to privacy considerations.
To address this issue, the programming language Python has been employed, along with the libraries OpenCV and face_recognition. A facial recognition model has been developed and trained using images of the company's employees. Upon initiating the program, the real-time camera is activated, and upon detecting the presence of one or more employees in front of it, the system automatically proceeds to identify their faces, determining whether they are authorized to access the event.
The program compares the captured face with images of employees stored in the system. In the case of a successful recognition, the employee's name and confidence percentage are displayed below the identified face on the screen. Entry is guaranteed if this percentage is equal to or higher than 70%. The visual indication "ACCESS GRANTED" is presented in these instances. On the other hand, if the face is not recognized, the bounding box is highlighted in red, and the message "Unknown - ACCESS DENIED" is displayed, indicating the prohibition of access.
If the employee has not been previously registered in the system, they have the opportunity to do so. They will be prompted to take a photograph of themselves. Once the image is captured, it is displayed on the screen, and the user is asked if they want to save it. If the response is affirmative, they will also be prompted to enter their name. Once the image is captured along with the name, it is stored in the system. If the user is not satisfied with the image, they will be asked to take another photograph, and the process is repeated.
The program allows for the registration of an unlimited number of employees and can be executed as many times as necessary. The facial recognition model is automatically trained each time the program runs, using the images of the employees stored in the system. This ensures that the model is consistently updated, enabling the recognition of all registered employees' faces.
pip install -r requirements.txt
streamlit run Facial_Recognition.py
⚠️Note
If you encounter the following error when running the program:
Please install face_recognition_models with this command before using face_recognition: pip install git+https://github.com/ageitgey/face_recognition_models
Run the following commands:
pip install wheel setuptools pip --upgrade pip install pip install git+https://github.com/ageitgey/face_recognition_models
Once executed, run the script again:
streamlit run Facial_Recognition.py
There are no datasets linked
There are no models linked
There are no datasets linked
There are no models linked