I built face recognition and a duplicate photo finder that run entirely in the browser
My photo folder had the usual problems: years of copies named IMG_0412 (1).jpg, and no way to find every picture of one person without uploading everything to a cloud service. So I built Photo Auditor. It finds duplicat
My photo folder had the usual problems: years of copies named IMG_0412 (1).jpg, and no way to find every picture of one person without uploading everything to a cloud service.
So I built Photo Auditor. It finds duplicate photos and groups photos by the people in them, and it does all of it inside a browser tab. There is no backend. Your photos are never uploaded.
Here is how the pieces fit together.
Reading a folder without uploading it
The File System Access API lets a page ask for a folder with showDirectoryPicker(). The user picks one, the browser grants read access, and the page can walk every file and subfolder. Writing, renaming and deleting need a second, separate permission, which is a nice safety property: scanning can never change a file.
The catch is browser support. Chrome and Edge on desktop have it. Safari, Firefox and phones do not, so the app says so up front instead of failing later.
The app itself is Flutter Web. The file access, hashing and model code live in small JavaScript helpers, and Dart talks to them through dart:js_interop.
Finding duplicates
Two passes:
- Identical files. Hash the file contents. Same hash means the same bytes, whatever the file is called. These are safe to pre-select for removal.
- Similar photos. A difference hash (dHash) shrinks each image to a tiny greyscale grid and records whether each pixel is brighter than its neighbour. Resized or re-compressed copies end up with nearly the same bits, so a small Hamming distance means "same picture, saved differently". These are grouped but never selected automatically.
For each group, the suggested keeper is the copy with the most pixels, then the largest file, then the oldest.
Recognising faces locally
Face work uses two small open models through ONNX Runtime Web:
- YuNet finds faces and their landmarks.
- SFace turns each aligned face into an embedding, a list of numbers where the same person lands close together.
Grouping is then a clustering problem over those embeddings. No clustering is perfect, so the UI makes fixing it cheap: merge two groups, move one face, or tighten the threshold without scanning again.
"Find a person from a photo" is the same idea in reverse: embed the reference face, then rank every stored face by similarity.
Making the second visit fast
A first scan of a big folder takes minutes. Results go into IndexedDB, so later visits only process new or changed files. Everything stored stays in the browser on that machine.
What I learned
- "Runs locally" is a feature people care about. For family photos it is the whole pitch.
- Browsers cannot use the Trash. A delete is permanent, so I added "Set aside", which moves copies to a review folder instead.
- Preview everything. Renames and moves are shown as a full list before anything touches the disk, and the last run can be undone.
Try it
photos.fullstackrohit.com is free, with no account. It needs Chrome or Edge on a desktop.
I would like to hear where it breaks, especially on large libraries.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.