← Back to Portfolio
Case Study — Cloud / Computer Vision

Face Recognition on
Amazon Rekognition

A Flask web app and an event-driven Lambda built on Amazon Rekognition, DynamoDB and S3: live camera or uploaded-photo recognition, person registration, health checks, and a separate used-car price analysis pipeline.

Python / Flask Amazon Rekognition DynamoDB S3 + Lambda IAM pandas / Seaborn ▶ Personal Project · 2025
4 AWS Services
6 Python Modules
7 Chart Types
λ Event-Driven Indexing
01 — The Problem

More Than One API Call

Rekognition can match a face, but a working system needs the pieces around it.

🧠

Faces are not names

Rekognition returns a face id, not a person. A lookup table is needed to turn a match into a name, and a way to register new people.

🔒

Permissions are easy to get wrong

Rekognition, S3 and DynamoDB each need exactly the right access. Too broad is unsafe, too narrow fails at runtime.

📊

A second goal: data analysis

The project also needed a real pipeline for messy tabular data, so a used-car dataset gets cleaned, analysed and charted.

02 — Architecture

How It Fits Together

Two ways in: the web app, and an S3 upload that triggers a Lambda.

Browser
Camera capture Photo upload Registration form
↓ HTTP to Flask
Flask app
/ recognition /registration /health
↓ service modules
Modules
detection.py database.py storage.py config.py logger.py web_interface.py
↓ boto3
AWS
Rekognition collection "famouspersons" DynamoDB: RekognitionId to FullName S3 image bucket
↓ S3 upload event
Event path
Lambda: IndexFaces DynamoDB put_item
03 — Features

What It Does

The two halves of the repository.

📷

Recognition

Search faces by image against the Rekognition collection, returning up to 10 matches with confidence and looking up each name in DynamoDB.

👤

Registration

A web form indexes a new face in the collection and stores the person's name against the face id.

💚

Health checks

A /health page reports connectivity to Rekognition, DynamoDB and S3 so a misconfiguration is visible immediately.

🚗

Used-car analysis

Loads a CSV, removes duplicates, fills gaps with median or mode, removes outliers with the 1.5 times IQR rule, then runs statistics and builds charts and a report.

📄

Logging

A dedicated logger writes structured activity, error and performance logs.

⚡

Auto-indexing

A Lambda function indexes any image uploaded to S3 and records the name, with no web request involved.

04 — Technology

Technology Choices

Managed AWS services for the hard parts, plain Python for the rest.

LayerTechnologyWhy
Face matching Amazon Rekognition Managed detection and matching against a collection; no model to train or host.
Person records DynamoDB Simple key lookup from RekognitionId to a person's name.
Image storage Amazon S3 Durable storage that can also trigger the indexing Lambda.
Web app Python + Flask A small server with a few routes and templates.
Access IAM policy Scoped to specific Rekognition actions, one bucket and the DynamoDB table.
Analysis pandas, Seaborn, Matplotlib Cleaning, statistics and charts for the car dataset.
05 — Decisions

Calls That Mattered

How the pieces were kept separate and safe.

01

Collection plus a lookup table

Rekognition stores faces by id, and DynamoDB maps each RekognitionId to a full name. Both the web registration and the Lambda write to the same pair, so recognition works the same regardless of how someone was added.

02

Small service modules with typed results

Detection, database, storage, config and logging are separate modules, and results are returned as dataclasses such as FaceMatch and DetectionResult, so the Flask routes stay short.

03

Validate images before calling AWS

Uploaded data is checked first, which avoids paying for and waiting on calls that would fail.

04

A scoped IAM policy

The policy lists the specific Rekognition actions, and limits S3 access to one bucket and its objects, instead of using broad permissions.

05

Health checks as a feature

Each service module has a health check, and the /health page shows them together.

06 — Hard Parts

What Needed Care

Cloud problems that only show up when you run against real services.

🚫 A 403 on the S3 health check

The check failed with Forbidden on HeadBucket. The cause was a mismatch: the bucket name and region in the code did not match the ones allowed by the IAM policy. Aligning them, and adding HeadBucket to the policy, fixed it, and the steps are documented in the repo.

✓ Code and policy aligned and documented

🔀 Two ways to register a face

A person can be added through the web form or by uploading to S3. Both paths index into the same collection and write the same DynamoDB record shape.

✓ One shared identity model

🧹 Messy source data

The car dataset had duplicates, gaps and extreme values. Cleaning is an explicit step: duplicates dropped, numeric gaps filled with the median, categorical gaps with the mode, and outliers trimmed by the 1.5 times IQR rule.

✓ Explicit, logged cleaning step

🔎 Seeing what failed

Cloud errors can be vague. Structured logs for activity, errors and performance, plus the health page, make failures easy to locate.

✓ Logging and health checks
07 — Outcomes

What This Demonstrates

What a reviewer can see in the repository.

4 AWS services Rekognition, DynamoDB, S3 and Lambda working together.
λ Event-driven An S3 upload alone triggers indexing and name storage.
IAM Least privilege A policy scoped to named actions and one bucket.
7 Chart types Histograms, box plots, trends, scatter, pie charts and a correlation heatmap.
6 Modules Clear separation between detection, data, storage, config, logs and UI.
3 Pages Recognition, registration and health status.
08 — Limits

Known Limits and What Is Next

Where the project is still a prototype.

🧪

Tests are missing

The repo does not yet include automated tests. Adding unit tests for each module and mocked AWS calls is the first improvement.

🧹

Repository hygiene

Logs, bytecode and sample uploads should not be committed, and sample data should be anonymised.

📐

What I would build next

A price-prediction model for the car data, containerised deployment, and CloudWatch monitoring.

Available for work

Want to build something
like this together?

I'm open to full-time roles and project work in AI engineering, full-stack development, and backend systems.