Face Sentinel runs face recognition on a Raspberry Pi 3 B+ with a Raspberry Pi Camera Rev 1.3. It treats enrolled people as allowed and sends an HTTP event to this PC when it sees a face that does not match the enrolled set.
The Pi config currently posts events to:
http://10.192.175.133:8765/event
If this PC gets a different IP, edit pi_agent/config.json and change receiver_url.
Run this on Windows from PowerShell:
cd C:\antigravity-projects\face-sentinel
python -m pc_receiver.serverKeep that terminal open. Incoming unknown-face events are saved to:
C:\antigravity-projects\face-sentinel\pc_receiver\received
If Windows Firewall asks, allow Python on the private/local network.
From PowerShell, once SSH works:
scp -r C:\antigravity-projects\face-sentinel aess@aess.local:/home/aess/Then SSH into the Pi:
ssh aess@aess.localOn the Raspberry Pi:
sudo apt update
sudo apt install -y python3-opencv python3-picamera2
cd /home/aess/face-sentinel
python3 -m pi_agent.download_modelsTest the camera separately if needed:
rpicam-still -o test.jpg --timeout 2000If rpicam-still is missing on your installed OS, try:
libcamera-still -o test.jpg --timeout 2000Create one folder per allowed person:
mkdir -p pi_agent/known_faces/alice
mkdir -p pi_agent/known_faces/bobPut several clear JPG/PNG photos of each person in their folder. Use different angles and lighting if possible. Then build the embedding database:
python3 -m pi_agent.enrollThis creates:
pi_agent/known_faces/embeddings.json
First dry-run locally on the Pi, without sending HTTP:
python3 -m pi_agent.run --dry-run --onceTo debug the complete camera/recognition/HTTP path, run monitor mode. This sends labelled frames to the PC at 2 FPS:
python3 -m pi_agent.run --monitor --monitor-fps 2Monitor frames are labelled as:
no_face
known
unknown
The PC receiver stores them under:
pc_receiver/received/monitor
Then run normally:
python3 -m pi_agent.runWhen an unknown face appears, the Pi saves a local event under:
pi_agent/events
and sends the same event to the PC receiver.
Edit pi_agent/config.json:
match_threshold: higher means stricter matching. If known people are rejected, lower it slightly. If strangers are accepted, raise it.unknown_cooldown_seconds: minimum seconds between unknown-face HTTP events.camera.width/camera.height: keep640x480on Raspberry Pi 3 B+ unless performance is poor.
pc_receiver/server.py PC HTTP receiver
pi_agent/config.json Pi configuration
pi_agent/download_models.py Downloads YuNet and SFace ONNX models
pi_agent/enroll.py Builds known-face embeddings
pi_agent/run.py Live camera loop
tests/ Unit tests for non-camera logic
cd C:\antigravity-projects\face-sentinel
python -m unittest discover -v