↗ Live Demo

Overview

Eidon is a real-time face recognition system built on ArcFace embeddings and SCRFD RetinaFace detection. It ships in two modes: a fully client-side browser app compiled from Rust to WebAssembly, and a Python backend with a FastAPI REST API. Both run entirely on CPU — no GPU, no cloud API, no paid services required.

The Problem

Face recognition demos either depend on cloud vision APIs (which means sending biometric data to a third party) or require a GPU and a non-trivial server setup. Neither option works for a privacy-conscious deployment on modest hardware. The goal was a system that runs on a consumer-grade CPU, stores nothing outside the device, and deploys to a static host.

How It Works

A SCRFD face detector locates faces and extracts 5-point landmarks. Those landmarks drive an affine alignment that crops and warps each face to a 112×112 patch, which is then passed through an ArcFace MobileNet backbone to produce a 512-dimensional L2-normalised embedding. Recognition is a cosine similarity lookup against stored embeddings — no training required after enrolment.

Input (webcam / image)
        │
        ▼
SCRFD RetinaFace detector  ──► 5-point alignment → 112×112 crop
        │
        ▼
ArcFace MobileNet (w600k_mbf)  ──► 512-dim L2-normalised embedding
        │
        ▼
Cosine similarity vs stored embeddings  ──► identity + confidence score

Both ONNX models (det_500m.onnx, w600k_mbf.onnx) are from the InsightFace buffalo_s pack and weigh in at under 10 MB combined.

Two Deployment Modes

ModeStackWhere data lives
Browser appRust → WASM, onnxruntime-web, LeptosEntirely in your browser (IndexedDB)
Python backendFastAPI + OpenCV webcamYour machine

Key Features

FeatureDetail
Privacy-firstNo images, frames, or embeddings ever leave the device in browser mode
Guided enrolment5-pose camera capture with geometric head-pose validation (yaw + roll)
Photo upload enrolmentEnrol from up to 10 images selected from disk
Live bounding-box overlayReal-time face detection with identity labels on the webcam feed
Profile managementView and delete stored identities from the browser UI
CPU-only inferenceRuns on an Intel N100 at ~80–150 ms per detection + embedding pass
REST APIFastAPI backend with /recognize, /enroll, /identities endpoints
Docker supportSingle docker compose up for the Python backend

Tech Stack

ComponentDetail
Browser frontendRust compiled to wasm32-unknown-unknown via Trunk, Leptos CSR
Inference (browser)onnxruntime-web loaded from CDN
Local storageIndexedDB via Rexie
Python packageFastAPI REST API, OpenCV, ONNX Runtime CPU
ModelsInsightFace buffalo_s: SCRFD det_500m + ArcFace w600k_mbf
DeploymentGitHub Pages (Pages workflow: download models → trunk build --release → deploy)

GitHub Repository

github.com/FrancescoCitti/eidon