GrabPic — Asynchronous AI Facial Recognition & Photo Tagging
An asynchronous ML pipeline using FastAPI, DeepFace, & DBSCAN clustering for batch event photo tagging.
Decoupled photo extraction from HTTP request threads.
Unsupervised face grouping via cosine distance.
High-speed selfie embedding lookup against PostgreSQL.
Processing high-resolution event photo uploads synchronously timed out serverless gateway limits (10s limit).
Bypassed HTTP timeouts using FastAPI BackgroundTasks, clustered unlabelled facial embeddings via DBSCAN, and enabled instant selfie-matching.
Project description
GrabPic processes high-resolution event photo uploads asynchronously using FastAPI BackgroundTasks, preventing gateway timeouts.
Utilizes DeepFace for facial embedding extraction and DBSCAN clustering on cosine distance metrics to group face embeddings into distinct unlabelled attendee personas.
Includes OpenCV image preprocessing for EXIF orientation and small face upscaling, plus instant selfie matching with UUID share tokens.
Why I built this
Event photographers needed a fast, automated way to group photos by attendee face without manual tagging or rigid pre-trained classes.
Architected to demonstrate how async ML queues can handle heavy computer vision workloads on serverless environments.
Process and execution
How the work moved
- Architected async ML pipeline with FastAPI BackgroundTasks to process high-res photos off main HTTP threads
- Implemented facial detection & embedding extraction with DeepFace and DBSCAN clustering on cosine distance metrics
- Built OpenCV preprocessing utilities to correct EXIF orientation and upscale small/distant face crops
- Developed high-speed selfie matching endpoint computing cosine similarity against PostgreSQL cluster embeddings with UUID tokens
What I owned
- Led the work as Backend & ML Architect.
- Turned messy context into a clearer operating model, interaction direction, and rollout shape.
- Worked across stakeholders to move the project from framing into execution.
Notable decisions
Unsupervised DBSCAN clustering
Clustered facial embeddings without pre-trained classes to dynamically group unlabelled event attendee photos.
Background task orchestration
Decoupled heavy DeepFace extraction from request threads, preventing gateway timeouts on batch photo uploads.
What I learned from this
DBSCAN clustering outperforms supervised classification when grouping unlabelled face embeddings.
EXIF orientation normalization is critical prior to facial landmark detection.