A webcam presence lock for Windows that knows you from everyone else. It locks when you walk away, recognizes your face to bring you back, and if an unknown face gets close to your screen it captures a photo and alerts you. It gets out of the way for video calls. Everything runs locally — no cloud, no account, no telemetry.
The main window recognizing its owner — the green box and match score
(You 0.83) mean it knows you. Also here: the camera picker, live preview, and
the strictness sliders. (Face blurred on purpose.) Setup wizard, soft cover, and
tray shots — plus a short clip of the cover lifting itself — coming next (recipe
in docs/DEMO.md).
An idle-timer lock is dumb: it fires while you're reading and stays open while you're gone. CrySence locks on presence, not a timer — and because it knows your face, it can dim softly and let you back in without a password, while still hard-locking for anyone else.
| 🧠 Knows your face | Enroll once (OpenCV YuNet detection + SFace recognition, local ONNX models). It tells you apart from anyone else and lets only you back in. |
| 🛡️ Layered locking | A soft cover drops when you step away and lifts itself the moment it recognizes you, no password. A stranger close to the screen, or a long absence, triggers a real Windows lock. If the camera disappears under the cover (unplugged, or its monitor switched off), it hands over to the Windows lock screen after a few seconds instead of leaving you stuck. |
| 🔑 Emergency unlock | On the cover, press Ctrl+Alt+Shift+U and type your unlock password (set in the main window) to get in without the camera. 3 wrong tries, or no password set, go to the Windows lock. |
| 📸 Intruder capture + alert | An unknown face close to your screen is photographed and clipped locally, with an alert through whatever channel you enabled (Windows toast + optional email / push). |
| 🎥 Meeting-aware | When another app uses your mic or webcam (Teams, Zoom, a browser call), CrySence releases the camera and pauses, then resumes when the call ends. Muting mid-call won't yank the camera back. |
| ⌨️ Keyboard-glance safe | Looking down at your keyboard reads as "still you," so it won't lock in your face. |
| ♻️ Auto-updates | The installer keeps itself current from GitHub Releases — the only outbound call you didn't configure yourself. |
This watches your webcam, so trust matters. CrySence is built to be auditable:
- 100% local. Face detection, recognition, and captures never leave your machine.
- No telemetry, no account, no network calls — except the update check
to GitHub and the alert channel you choose to configure. That's it, and you
can read every one of them in
crysence/notify.pyandcrysence/updater.py. - Update check: the packaged app asks GitHub (
api.github.com) for the newest release on start and every hour. Nothing about you is sent. Turn it off in the tray menu: Check for updates automatically. - Alerts (all off by default) send the alert text and, if you choose, the captured photo to the service you set up (your SMTP server, ntfy, Telegram or Resend). That service's own privacy policy applies.
- The installer shows this notice before it installs.
- Your face is stored only as a numeric embedding (
owner_face.npy), never as images. - No secrets in this repo. All config lives under
%LOCALAPPDATA%\CrySence\.
Don't trust a binary that watches your camera? Run it from source (below) and read the ~1k lines yourself.
git clone https://github.com/crymetr/crysence
cd crysence
python -m pip install opencv-python-headless numpy pillow winotify pystray customtkinter
python -m crysence
A tray icon appears; a first-run wizard walks you through camera, face enrollment, lock mode, and (optional) alerts.
Grab CrySence-Setup-x.y.z.exe from the
latest release. It's a
per-user install (no admin) and auto-updates itself from future releases.
It isn't code-signed, so SmartScreen will warn ("unknown publisher"). Right click the file → Properties → Unblock → OK, then run it. Or just run from source above.
| Setting | Meaning | Default |
|---|---|---|
| Soft dim after (s) | Seconds not present before a soft cover | 15 |
| Recognize | Match strictness to count as "you" | 0.50 |
| Stranger close (hard lock) | How big a stranger's face means "at your screen" | 0.30 |
| Layered | Soft cover first, then hard lock (off = Windows lock only) | on |
Windows toast is always on. To also get notified when you're away, enable a
channel in the wizard or in %LOCALAPPDATA%\CrySence\config.json
(config.example.json shows the shape):
- ntfy — simplest: pick an unguessable topic, subscribe on your phone. No account.
- SMTP email — any provider (Gmail needs an App Password).
- Telegram — a bot token + chat id.
- Resend — if you have a verified domain + API key.
Only fill in what you use. Nothing is sent anywhere you didn't set up.
Honest edges — a tool that watches your camera shouldn't hide them:
- The soft cover is privacy, not security — it can be killed via Ctrl+Alt+Del → Task Manager, which no user-mode app can block. The hard Windows lock is the real thing.
- No liveness detection yet. Recognition is 2D, so a good printed photo of you could satisfy it. Treat CrySence as a convenience + privacy tool, not defense against a determined, prepared attacker. (Liveness is on the roadmap.)
- Windows only. Recognition accuracy depends on your webcam and lighting — the strictness slider is there for a reason.
- Activity log — a local timeline of lock / unlock and intruder events you can scroll back through, so you can see who came and went while you were away even if you never set up an alert channel.
- Liveness / anti-spoof (so a photo can't pass)
- Code signing (drop the SmartScreen warning)
- Per-app "always allow this face" for a shared desk
- Linux and macOS support
Windows releases (the installer and the portable zip) are built by GitHub Actions straight from this repository. Signing them through the SignPath Foundation open source program has been applied for; until then they are unsigned.
- Committers and reviewers: repository contributors
- Approvers: owner
Every release tag is approved by hand before it is published. See Privacy first for what the app sends over the network.
- Added: "Check for updates automatically" in the tray menu (on by default). Turn it off and CrySence makes no network calls unless you set up an alert; "Check for updates" still works.
- Added: the installer shows a short privacy notice before it installs.
- Changed: the app checks for updates every hour while it runs, not only at startup, so you no longer have to restart it to see an update.
- Added: "Check for updates" in the tray menu checks right away and tells you if you're already on the latest version.
- Fixed: after the webcam's monitor was switched off for a long time, the app could freeze for good inside the camera driver and grow to several GB of memory. The camera now runs in a small separate process. If a camera call hangs (5 s for a read, 10 s for an open), that process is killed and a fresh one starts. The window, tray, and cover keep running, and the driver's leaked memory goes with the old process.
- Fixed: after a camera disconnect the engine could get stuck in an error loop and only came back after a manual Rescan. A camera handle that throws is now closed and reopened automatically.
- Fixed: Rescan could crash the app while the engine was using the camera. All camera probing now runs on the engine thread (Rescan and the setup wizard).
- Fixed: with the monitor webcam off, Windows can give its slot to another camera (for example a closed laptop lid that streams black). After a real disconnect, black frames now count as "camera lost", so the Windows lock still happens. A webcam that just dozes off still doesn't lock.
- Fixed: after the webcam's monitor was switched back on, the app could stay on "camera unavailable (asleep?)" with a frozen preview. A camera that fails or streams only black is now closed and reopened every 5 s until real frames come back. Camera loss, recovery, and blocked reads are written to the log.
- Fixed: turning off the monitor with the webcam (or unplugging the webcam) while you're at the desk did nothing; the app just paused. Now, if the camera disappears while guarding, the PC goes to the Windows lock screen after 6 s. A webcam that is only asleep (black frames) still doesn't trigger it.
- Added: the version is shown in the window title, under the logo, in the tray tooltip, and at the top of the tray menu.
- Fixed: "Install update" could hang: the app left an invisible process behind and the installer waited forever trying to close it. The app now exits for real, and the installer waits a few seconds, then force-closes a stuck copy. Quit uses the same clean exit.
- Fixed: the soft cover no longer stays up forever when the webcam goes away (for example a monitor-mounted camera when the monitor is switched off). After 6 s without a camera frame it goes to the Windows lock screen.
- Fixed: the cover resizes itself when a monitor is added, removed, or wakes up.
- Added: emergency unlock. Ctrl+Alt+Shift+U on the cover asks for a password (salted PBKDF2, set via "Unlock password" in the main window).
- Fixed: no more false lock when the webcam briefly sleeps under USB power management.
- Added: self-update straight from GitHub Releases (per-user, no admin).
- Added: packaging — PyInstaller build, per-user Inno Setup installer, portable install, and a GitHub Actions release workflow.
- Changed: hardened after an internal security review.
- Initial release: local webcam presence lock with owner recognition, layered soft/hard lock, meeting-aware pause, and pluggable alerts.
- Modern CustomTkinter GUI with a first-run setup wizard.
Poke around the rest of what I build at cryme.tr.
Face models from the OpenCV Zoo: YuNet (detection) and SFace (recognition).
MIT — see LICENSE.

