FaceRec Guard is a macOS-focused face lock tool. It keeps your session active while an authorized face is visible and locks when no authorized face is present for a configured timeout.
- Face detection and recognition pipeline (
face_recognition+ OpenCV) - macOS lock action through
CGSession -suspend. - Enrollment command that captures your face embeddings and saves them locally.
- Unit-tested lock-state logic.
- Nix flake dev environment.
- Home Manager module for shell aliases and project environment variables.
Policy hardening
- Lock on absence of authorized faces only.
- Keep unlocked when authorized + unauthorized are both visible.
Reproducible environment
- Add
flake.nixdev shell with Python and required build/runtime tools.
brew install --cask ./Casks/facerec-guard.rbbrew tap ariz/facerec
brew install --cask facerec-guardnix develop python -m unittest discover -s tests -p "test_*.py" python -m app.enroll --samples 12 --output data/authorized_faces.json python -m app.main --timeout 10 --fps 5 --embeddings data/authorized_faces.json --show-preview --dry-run
Apply:
home-manager switch --flake .#ariz@facerecAliases:
facerec-devfacerec-testfacerec-enrollfacerec-run
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m unittest discover -s tests -p "test_*.py"