My door knows my friends. Not strangers. Ring the bell and the doorbell names the person at the door – if they are a housemate it has been taught to recognise. Anyone else is simply unknown, and gets a snapshot saved, not a name.

What it does
Enrol 1-5 photos per housemate, and Frigate plus ArcFace names them when they ring. A stranger is never named – they are shown as unknown and a snapshot is saved so you can see who was there.
- Enrol 1-5 photos per housemate
- Frigate spots the face, ArcFace matches it
- Friends are greeted by name
- Strangers are unknown, with a snapshot saved
A note on consent and privacy: only enrol people who agree to it, keep no database of strangers, and delete a person’s photos and embeddings if they ask you to. A doorbell that recognises faces is a trust thing as much as a tech thing.
Who it recognised
In demo mode, the doorbell recognised Priya with similarity 0.966 and distance 0.034, and Alex with similarity 0.964 and distance 0.036. The stranger was unknown – their closest match was Alex at just 0.020, far below the 0.60 threshold.

| Person | Similarity | Distance | Result |
|---|---|---|---|
| Priya | 0.966 | 0.034 | Recognised |
| Alex | 0.964 | 0.036 | Recognised |
| Stranger | 0.020 (closest: Alex) | – | Unknown |
Those are demo scores. Real housemate scores are usually 0.65-0.85, not the demo’s 0.97 – real faces, real lighting and real camera angles are messier than the demo set, which is exactly why the threshold is set at 0.60.
How it works
YOLOv8n spots the face in the camera frame, ArcFace turns that face into an embedding – a long list of numbers that captures what the face looks like – and Frigate runs the whole pipeline on the Pi 5, watching the camera and raising an event when someone rings.

- The camera sees someone at the door
- YOLOv8n finds the face in the frame
- ArcFace turns the face into an embedding
- The embedding is compared with the enrolled housemates
- A match names the person; no match means unknown, plus a snapshot
The maths
An embedding is a face turned into numbers. Two photos of the same person give embeddings that point in nearly the same direction, and the distance between them is small. The distance here is the cosine distance between two embeddings, and similarity is simply 1 – distance. Priya at distance 0.034 has similarity 1 – 0.034 = 0.966, and Alex at distance 0.036 has similarity 0.964.
The threshold is 0.60: a face is only named when its similarity to an enrolled person is at least 0.60. The stranger’s best match was Alex at 0.020 – nowhere near 0.60 – so the doorbell correctly said unknown instead of guessing a name.
What you need
- Raspberry Pi 5
- A camera
- Frigate
- ArcFace
Demo mode needs no Pi, no camera and no model download – it runs on the sample embeddings so you can see the matching and the threshold work straight away.
Build it
Install the dependencies, enrol your housemates, and try the recogniser.
pip install -r requirements.txtpython enrol.py --name Priya --photos photos/priyapython recognise.py --demopython recognise.pyThe code

face-doorbell/
+-- config.py
+-- embeddings.py
+-- enrol.py
+-- recognise.pyembeddings.py turns faces into numbers and compares them:
import numpy as np
def cosine_distance(a, b):
a = np.array(a, dtype=float)
b = np.array(b, dtype=float)
denom = np.linalg.norm(a) * np.linalg.norm(b)
if denom == 0:
return 1.0
return 1.0 - float(np.dot(a, b) / denom)
def similarity(a, b):
return 1.0 - cosine_distance(a, b)
def match(embedding, known, threshold=0.60):
best_name = None
best_score = 0.0
for name, vectors in known.items():
for vector in vectors:
score = similarity(embedding, vector)
if score > best_score:
best_name = name
best_score = score
if best_score >= threshold:
return best_name, best_score
return "unknown", best_scorerecognise.py runs the doorbell – detect a face, embed it, and name it or say unknown:
from embeddings import match
def recognise(embedding, known):
name, score = match(embedding, known)
if name == "unknown":
print(f"Unknown visitor (closest match {score:.3f}) - snapshot saved")
else:
print(f"Hello, {name}! (similarity {score:.3f})")
return name, scoreWhat broke
Enrol photos taken in different lighting scored low – the same person in a dim hallway and in bright daylight gave embeddings far enough apart to fall under the threshold. The fix is in the enrolment: enrol 1-5 photos per person in different light, so the doorbell has seen each housemate in the conditions it will actually meet them in.
Download the project
Unzip the project, pip install the requirements, then run recognise.py –demo to see Priya and Alex recognised and the stranger marked unknown.
Premium Download
Get the complete project code
