Skip to content
STARMATCH

How it works

StarMatch is a face similarity search. It turns a photo into a point in 128-dimensional space and finds the nearest points among 2066 pre-computed public figures.

Why it runs in the browser

The original library this project grew out of — ageitgey/face_recognition — is Python on top of dlib, roughly 100MB of compiled C++ and model weights. That will not fit in a serverless function, and putting it behind a server would mean accepting uploads of people’s faces.

Moving inference to the client solves both at once. The same descriptor lineage — a ResNet-34 producing 128 floats — runs in WebGL through TensorFlow.js, so the photo stays on the device and the host stays a static CDN.

Building the gallery

A SPARQL query against Wikidata returns well-known people, ranked by how many Wikipedia language editions cover them. Each portrait is resolved on Wikimedia Commons and rejected unless its licence permits redistribution. The surviving images are embedded offline and packed into a single 1033KB binary of Float32 vectors.

Why the score is a percentile

A raw distance means nothing to a reader, and mapping it to a percentage with an invented formula would be worse — it would look precise while meaning nothing.

Instead, every pair of different people in the gallery was measured: 2,133,145 stranger distances. Your score is where your match falls in that real distribution. “Closer than 98% of stranger pairs” is a claim that can actually be checked.

Distance between different people

All 2,133,145 pairs in the gallery. Everything left of the dashed line is a pair of strangers that the conventional threshold would call the same person.

What the numbers cannot do

The overlap visible above is the important result. A threshold tuned to catch the same person also catches strangers, and no amount of interface polish fixes that. The ethics page covers what follows from it.

Reproducing it

The whole index is rebuildable from scratch in three commands:

npm run gallery:fetch   # Wikidata + Commons, licence-filtered
npm run gallery:build   # embed portraits, pack vectors, calibrate
npm run gallery:verify  # rank a held-out photo per subject