An Android app that recognises people through the camera: it finds faces on-device, collects frames of anyone it doesn't know, and asks a self-hosted recognition service who they are.
This is a fork. The app and the client library are the work of @skokourov — see skokourov/FaceIdDemo for the original. My own commit here added Crashlytics and cleaned up committed IDE files. The fork is kept for the record.
Archived. Built in 2017 against Android SDK 25 and Google Play Services 10, targeting a demo server that is long gone. It will not run as-is.
This was built before face recognition was something you called an API for. The split it uses is the interesting part:
- Detection runs on the phone — Google Play Services Mobile Vision finds and tracks faces in the camera preview. Cheap, fast, no network.
- Recognition runs on our own server — frames go to a self-hosted service that answers "who is this?", and can be retrained as new people are enrolled.
That second half is the part that dates it. In 2017 there was no managed service to call: you picked a model — OpenFace and FaceNet were the options at the time — trained it yourself, hosted the inference, and wrote your own client. Today the equivalent is three lines against someone else's endpoint. The architecture here is what that era's version looked like.
The app watches the camera through Mobile Vision's face tracker, which calls back as faces come and go. FaceDetectManager turns that stream into a recognition workflow:
- Frames are kept in a rolling buffer, capped at 100, so there's always recent footage of whoever is on screen.
- When the tracker reports a new face, the manager asks the service for a person ID matching it.
- Known person → fetch their details and display them.
- Unknown person → offer to enrol them. Enrolment needs at least 10 images, which is what the buffer was accumulating.
- When the face leaves the frame, the tracker fires
missedFaceand the session for that face ends.
Face tracking is in GraphicFaceTracker and the overlay drawing in FaceGraphic / GraphicOverlay.
faceId-library is a standalone Volley-based client for the recognition service, usable outside this demo. It's a thin async wrapper — every call takes a callback:
| Call | Endpoint | Purpose |
|---|---|---|
AddPersonCall |
api/addPerson/ |
Enrol a new person from a set of images |
GetPersonIdCall |
api/getPersonId/ |
Identify a face — returns a person ID |
| — | api/getPersonInfo/ |
Fetch stored details for a person |
| — | api/setPersonInfo/ |
Update those details |
| — | api/retrain/ |
Retrain the model after enrolments |
Requests extend AbstractFaceIdCall; images travel base64-encoded.
app/ the demo application — camera, tracking, enrolment UI
faceId-library/ Volley client for the recognition service
The app depends on the library as a published artifact (com.ipoint-consulting.faceid:library), with the local project(':faceId-library') dependency commented out in app/build.gradle — swap them to build against the source in this repo.
Server URL and demo credentials are constants in FaceId and FaceDetectManager; both point at infrastructure that no longer exists.