Device that greets recognized faces and can alert the tenant on intrusion. The architecture is designed with Capella; implementation runs on Raspberry Pi with a camera and speaker.
- Install Python deps:
pip install -r requirements.txt - Set email env vars for alerts:
ALERT_SENDER_EMAILALERT_EMAIL_PASSWORDALERT_RECEIVER_EMAIL
- Train encodings (writes
facial_recognition/encodings.pickle):python -m facial_recognition.training - Run recognition + greeting loop:
python -m facial_recognition.app - Capture new headshots (PiCamera):
python -m facial_recognition.capture(press Space to save, Esc to quit)
facial_recognition/app.py: main recognition + greeting loopfacial_recognition/recognition.py: face detection/recognition enginefacial_recognition/training.py: build and persist face encodingsfacial_recognition/capture.py: collect training headshots from PiCamerafacial_recognition/speech.py: text-to-speech greetingsfacial_recognition/alerts.py&email_settings.py: email alert client + env-driven credentialsfacial_recognition/constants.py: shared runtime constants (encoding path, labels)facial_recognition/validation.py: evaluate encodings against a labeled validation set
- Create a labeled validation folder similar to the training dataset:
validation/<person_name>/*.jpg
- Run validation logging:
python -m facial_recognition.validation --validation-dir validation
- Review
validation.logand tuneMATCH_THRESHOLDinfacial_recognition/constants.py(or pass--thresholdto the validation script) until false accepts/unknowns match your needs.
- Capella 5.2.0 (to open the system model)
- Raspberry Pi 4 with camera and audio output (for runtime)
The Logical Architecture describes the main architectural concepts. On the diagram below, the high-level architectural components and their functionalities are presented. Some design decisions are also made such as the choice of an audio message rather than a text message to greet people.
The Physical Architecture describes the technological choices. Here we will make use of a RaspberryPi 4 and a camera to detect and recognize faces.


