How I built TrueFace: a real-time AI face recognition system
Next.js, FastAPI, FaceNet, MTCNN and SQLite.
Javed Hussain
Founder of CoachingsNearMe.in · Teghra, Bihar
Designing an In-Browser Biometric Flow
TrueFace was created to bridge browser frontend ergonomics with high-throughput neural network inference. The user interface streams frames via an HTML5 canvas over an asynchronous HTTP protocol to a Python backend powered by FastAPI.
Face Detection and Landmark Alignment with MTCNN
Raw images vary wildly in lighting and head tilt. Using Multi-task Cascaded Convolutional Networks (MTCNN), TrueFace locates faces, pinpoints 5 key facial landmarks (two eyes, nose tip, and two mouth corners), and performs affine transformations to produce perfectly centered, normalized facial crops.
Vector Space Embeddings with FaceNet
Aligned crops are passed into FaceNet, which outputs 512-dimensional vector embeddings. Identities are verified by calculating Euclidean or cosine distance against enrolled embeddings stored in an indexed SQLite database, reliably matching identities at 15–30 frames per second.