
Better Facial Recognition Management In Unifi Protect
So I have been very frustrated with trying to manage facial recognition in UNIFI protect. I find the whole process very clunky and difficult to manage lots of unknown faces and assigning them correctly.
So I reverse engineered the API my UNIFI UDM uses. I then got Claude to build the front end and back end for the app. Yes this is AI Slop code but I just wanted something simple and quick to make managing it easier.
https://github.com/magnetarhotelrwanda/unifi-facegraph
What it does:
- Known Faces / Unknown Detections dashboard — see everyone Protect has already named, and everyone it hasn't, side by side.
- Batch assign — select a pile of unknown detections and assign them all to a known person in one click, or the reverse (unassign back to unknown).
- Manage known people — view every detection tied to a person, reassign/unassign individual ones, delete a person entirely, or create a brand-new person straight from an unnamed face.
- Local face recognition (the fun part) — a separate page runs its own face-recognition model (InsightFace, 100% local, CPU-only, no cloud, no UniFi recognition data used) against your known people's photo history and suggests matches for every unknown detection, with a confidence threshold and quality filtering to cut down on bad matches. Batch-approve everything in one go.
- Clustering — a third page that compares unknown faces against each other (not against known people) to spot a recurring face that's never been named — like the postman who shows up daily but was never tagged — and lets you name or assign the whole group at once.
How it works under the hood: it's a lightweight Flask + vanilla JS app that proxies a handful of undocumented UniFi Protect API endpoints (reverse-engineered via HAR capture, since none of this is in Ubiquiti's public Integration API). Auth is just your normal controller login — nothing is stored on disk, session lives in memory only for as long as the server runs.
Running it: Docker or a direct Python install, your choice both documented in the README. HTTPS-only with an auto-generated self-signed cert.