Lock Sense is a local, lightweight software solution designed to automate workstation security through real-time face recognition and presence analysis. Initially developed to mitigate the risks of session compromise in shared academic environments (such as the busy open spaces at Epitech), the system instantly locks the machine as soon as the authorized user steps away.
By continuously analyzing the webcam feed, your machine becomes "aware" of your physical presence:
- Are you in front of your screen? The system remains active.
- Do you step away or does a stranger sit down? The script detects the anomaly and instantly locks the session.
- Zero Human Error: No more relying on memory to hit
Win + LorCtrl + Alt + Levery time you stand up. - Rapid Response: Locks the workstation within seconds, closing the vulnerability window left by standard OS idle-time sleep settings.
- 100% Local Processing: Absolute privacy. No images or biometric data ever leave your machine or get uploaded to third-party servers.
- Smart Delay (Anti-False Positives): Features a 3-second tolerance threshold to prevent accidental locking during natural head movements or blinking.
- Language: Python 3.x
- Key Libraries:
OpenCV: Handles the webcam video stream capture and downsampling optimizations.MediaPipe(Face Detection): Highly optimized first-level filtering to detect a human face with minimal CPU impact.Face Recognition(In progress): Extracts facial landmarks and performs continuous biometric verification against the authorized profile.
- Capture & Downsampling (OpenCV): Acquires the webcam video stream and resizes it to a lower resolution to preserve CPU cycles.
- Detection (MediaPipe): Rapidly checks for the presence of any human face.
- Authentication (Face Recognition): Compares facial features with the pre-registered owner's profile if a face is detected.
- System Action: Triggers a native OS command to lock the session immediately if the user is absent or unrecognized.
Ensure you have Python 3 installed, along with the compilation tools required for dlib (such as CMake).
# On Ubuntu / Debian
sudo apt-get install cmake build-essential libgtk-3-dev libboost-python-devgit clone git@github.com:Marcellin752/LockSense.git
cd LockSensepython3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpython3 src/main.pyThe project is currently focusing on reducing its CPU footprint and optimising the Face Recognision sytem. Real-time image processing is computationally expensive.
👤 Author
Marcellin SAMBIENI - Epitech Student