Face matching & active liveness

Face match uses DeepFace to compare a selfie with the portrait from an ID document. Liveness uses MediaPipe Face Mesh on a short burst of webcam frames: you are prompted to blink or smile so a static printed photo is less likely to pass.

This is a demo-grade signal, not a certified PAD (presentation attack detection) solution. Tune thresholds and add server-side risk controls for production financial use.

1. Face match (DeepFace)

Crop the ID photo to the face if the full card is scanned. Selfie should be front-facing, good light.

2. Active liveness (MediaPipe)

Allow camera access. Start the camera, then run a challenge.

Max 24 frames per request; burst capture stays within that limit.

API

POST /identity/api/face-match/ — multipart: id_photo, selfie (synchronous response).

POST /identity/api/face-match/async/ — same fields; 202 with request_id, status (Pending), and status_url. Poll GET status_url until status is Completed or Failed; then read result or error.

POST /identity/api/liveness/ — multipart: challenge (blink | smile), repeated frames (JPEG).