AR Smart Mirror
Real-time interactive AR virtual try-on system designed for retail fashion.
The Problem
In-store clothing fitting is slow, creates long queues in fitting rooms, and increases garment wear. Retailers need an instant, hygienic, and engaging digital mirror that lets shoppers visualize outfits without undressing.
My Role
Built solo with AI-assisted development — computer vision pipeline design, MediaPipe pose detection integration, Canvas AR overlay engine, FastAPI backend services, Docker multi-container topology, and Cloudflare Zero Trust ingress.
Highlights
- Sub-30ms real-time body tracking and landmark extraction using MediaPipe Pose
- Dynamic Canvas AR garment warping and affine transformation for realistic clothing drape
- FastAPI backend with PostgreSQL catalog and Redis session pub/sub synchronization
- Mobile controller pairing allowing customers to browse catalogs and trigger try-ons from their smartphones
- Production-grade Docker Compose architecture with Nginx reverse proxy and Cloudflare Tunnel
Stack
Constraints
- Hard real-time latency target (<33ms per frame / 30 FPS) to avoid motion sickness and visual lag.
- Zero customer biometric persistence — video feeds must process in memory without saving raw footage to disk.
- Compatibility with standard consumer hardware (e.g. RTX 3060) without requiring specialized depth cameras.
System Architecture
Key Trade-offs
The decisions worth defending — what I chose, what I turned down, and why.
Pose tracking execution model
Chose
Client-side MediaPipe Pose on Canvas API with GPU acceleration
Rejected
Server-side video streaming and frame-by-frame inference
Server inference introduces network jitter, high bandwidth overhead, and privacy concerns streaming raw camera feeds over the network.
Garment deformation approach
Chose
Real-time 2D affine mesh deformation keyed to skeletal anchor landmarks
Rejected
Full 3D physics-based volumetric cloth simulation
3D cloth simulation cannot sustain 30+ FPS on edge kiosk hardware; 2D mesh triangulation provides fluid response with low computational cost.
Remote store interconnect
Chose
Cloudflare Tunnel over outbound HTTPS
Rejected
Direct port forwarding and dynamic DNS on store routers
Retail store Wi-Fi and ISP firewalls prevent inbound port forwarding; Cloudflare Tunnels punch through NAT securely without public IPs.
What I'd Do Differently
An honest retrospective — the stuff I'd change with more time, more users, or a second pass.
- 1Implement WebGPU shaders for cloth lighting and shadow blending to improve realism under dynamic store lighting.
- 2Add an offline fallback queue for store analytics so telemetry buffers locally during internet interruptions.
- 3Optimize landmark smoothing filters (OneEuro filter) to eliminate micro-jitter when shoppers stand at edge distances.
Computer Vision & Pose Tracking Shell
Benchmark the real-time AR try-on pipeline (status, camera init, pose detect, mesh align -shirt, latency bench).
Technical Deep-Dive
Architecture, specifications, and implementation details.
AR Smart Mirror — Project Documentation
#Overview
Real-time Augmented Reality try-on system for retail clothing stores. Customers see themselves wearing any garment — instantly, without undressing.
#Stack
- Frontend: HTML5 · CSS3 · Vanilla JS · Canvas API · MediaPipe Pose
- Backend: Python 3.11 · FastAPI · Docker Desktop · Docker Compose
- Database: PostgreSQL 15 · Redis 7
- Infrastructure: Nginx · Cloudflare Tunnel · Grafana · Prometheus
#Product
AR Smart Mirror — B2B white-label AR try-on system for clothing stores across Romania.
#Developer
Popa Matei — Ice Legends Enterprises alexmatei2330@gmail.com — +40 730 155 075
#Target Clients
Any clothing store in Romania: LPP Group (Reserved, Cropp, House, Mohito, Sinsay) Inditex (Zara, Pull&Bear, Bershka, Stradivarius) H&M Group · Nike · Adidas · Intersport · C&A · Takko
#Document Index
| File | Description |
|---|---|
| 01_SPEC_Master | Full system specification |
| 02_API_Contracts | REST API endpoint definitions |
| 03_System_Architecture | Architecture diagrams and layer overview |
| 04_PostgreSQL_Schema.sql | Database DDL — tables, indexes, constraints |
| 05_Docker_Compose_Config | docker-compose.yml and service definitions |
| 06_Cloudflare_Tunnel_Setup | Remote access via any WiFi |
| 07_Frontend_Architecture | HTML/JS/Canvas/MediaPipe structure |
| 08_MediaPipe_Integration | Pose detection implementation details |
| 09_Garment_Processing_Pipeline | How garments are overlaid in real time |
| 10_Security_Model | JWT, rate limiting, Cloudflare Zero Trust |
| 11_Performance_Benchmarks | SLAs, targets, optimization strategies |
| 12_Development_Roadmap | 14-week phased delivery plan |
| 13_Cost_Analysis | Hardware tiers, software costs, ROI |
| 14_Production_Runbooks | Day-to-day operational procedures |
| 15_Disaster_Recovery_Playbook | Failure scenarios and recovery steps |
| 16_Staff_Operations_Guide | Store staff daily guide |
| 17_Customer_User_Guide | In-store customer instructions |
| 18_V1.0_Release_Notes | First release changelog |
| ci/ | Shell scripts: health-check, release-gate, DB restore |
#Quick Start
git clone https://github.com/yourname/ar-mirror.git
cd ar-mirror
cp .env.example .env
docker compose up -d
# Open: http://localhost