To make a Screen Lock using Python (OpenCV and Tkinter).
This project is useful for anyone who needs a screen lock that can be unlocked on correct Face Detection
-
If standalone script, short description of script explaining what it achieves.
Using this script user can lock or unlock screen and it will use face detection to verify correct user
-
List out the libraries imported.
- keyboard==0.13.5
- pynput==1.7.3
- numpy==1.19.0
- gTTS==2.2.3
- face_recognition==1.3.0
- playsound==1.2.2
- pywin32==228
- opencv_python==4.4.0.42
- Pillow==8.3.1
Install Python 3.7 + Install all dependences mentioned in requirements.txt using pip install -r requirements.txt First Run faceRegister.py Then run lockScreen.py
- First we are importing all necessary libraries
- Then Run faceRegister.py and register your face
- Once Registerd you can see one Image File of your face present in the faceRegister folder
- We will be using this image to verify face while screen lock is running.
- Then to lock screen run lockScreen.py file
- Here you can put custom background music or wallpaper if you wish to do so
- Next Enter your name which was used while registering (This is important step)
- Screen will be then locked
- Now if no one is in front of camera the screen will continue to be locked and music will play
- If face detected and its wrong then it will say wrong person detected
- If correct face is detected the program will test it for 10 iterations and then screen will be unlocked
Check Out this Youtube Video for Demo https://www.youtube.com/watch?v=PjGLWq3LrhM&ab_channel=TusharAmdoskar
Tushar Vaman Amdoskar
Find me on Linkedin : https://www.linkedin.com/in/tushar-amdoskar/
This script is specifically designed for Windows operating system and will certainly not work on Linux or Unix systems.