Case index
Case File 002Status: Closed2024

GrabPic — Asynchronous AI Facial Recognition & Photo Tagging

An asynchronous ML pipeline using FastAPI, DeepFace, & DBSCAN clustering for batch event photo tagging.

Latency fix
< 10s async

Decoupled photo extraction from HTTP request threads.

Clustering
DBSCAN

Unsupervised face grouping via cosine distance.

Matching engine
UUID Token

High-speed selfie embedding lookup against PostgreSQL.

Opening brief

Processing high-resolution event photo uploads synchronously timed out serverless gateway limits (10s limit).

Outcome on record

Bypassed HTTP timeouts using FastAPI BackgroundTasks, clustered unlabelled facial embeddings via DBSCAN, and enabled instant selfie-matching.

Exhibit A

Project description

Filed statement

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.

Exhibit B

Why I built this

Filed statement

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.

Exhibit C

Process and execution

Approach

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
Responsibilities

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.
Exhibit D

Notable decisions

Decision

Unsupervised DBSCAN clustering

Clustered facial embeddings without pre-trained classes to dynamically group unlabelled event attendee photos.

Decision

Background task orchestration

Decoupled heavy DeepFace extraction from request threads, preventing gateway timeouts on batch photo uploads.

Exhibit E

What I learned from this

Filed statement

DBSCAN clustering outperforms supervised classification when grouping unlabelled face embeddings.

EXIF orientation normalization is critical prior to facial landmark detection.