Face recognition
Turn on the webcam: every new face is measured by a neural network and gets a numeric fingerprint and a made-up name, male or female depending on appearance. When the same face comes back into view, even after leaving, it is recognized and framed with its name.
Camera images stay on this device.
Faces seen
The memory lives only in this tab: reloading the page forgets every face.
How it works
- Detection: a small convolutional network (Tiny Face Detector, 190 kB) finds the faces in every frame; a second network locates 68 landmarks (eyes, nose, mouth, jaw line) to align each face.
- Face fingerprint: a ResNet trained for face recognition turns the aligned face into a vector of 128 numbers. Pictures of the same face give nearby vectors, different people distant ones: two faces count as the same person when the Euclidean distance is below the threshold (0.6 by default). While a face stays in the same place in the frame it is followed through pose changes, and the new pose is stored.
- Hash and name: a new face is stored after 4 sharp frames. The mean of its vectors, quantized, goes through SHA-256: the hash shown in the list. The hash picks the made-up name from a male, female or neutral list, according to the gender estimate.
- Recognition: in every frame each face's vector is compared with the stored ones; up to 20 vectors from different poses and lighting are kept per person, so recognition improves the more a face is seen.
- Privacy: the networks (7.6 MB) are downloaded once and run on your device's GPU with TensorFlow.js. Images, vectors and names never leave the browser and are not stored.
Limits
The hash is not a stable identifier: two measurements of the same face are never identical, so the same face gets a different hash in every session. Recognition works by distance between vectors, not by equal hashes. Gender is a binary estimate from appearance and is often wrong in poor light, in profile, with glasses or beards; when the estimate is uncertain a neutral name is used. Twins, strongly turned heads and backlight can confuse the model.
Computer vision for production
The same techniques (detection, embeddings, matching against a gallery) recognize parts and defects, check assemblies or count items on the line, with models trained on your data running on local devices.