All AR processing happens in the browser using JavaScript/TypeScript, eliminating server-side computational overhead and ensuring low-latency interactions.
Utilizes MediaPipe FaceMesh (or similar ML models) to detect 468+ facial andmarks in real-time, enabling precise positioning of accessories on facial features like ears, nose bridge, cheekbones, and neck.
A 2D rendering context draws product images with dynamic transformations (scale, rotation, translation, opacity) synchronized to facial movements at 30-60 FPS.
JSON-based product definitions store dimensional metadata (default scale, anchor points, offset coordinates, rotation angles) allowing non-technical users to add new products without code changes.
Adaptive algorithms adjust product sizing based on detected face width, ensuring consistent visual appearance across different devices, camera resolutions, and user distances.
The module integrates seamlessly into React/Next.js applications as reusable components, providing hooks for product selection, camera controls, and AR state management.
Users browse and select products from the product catalog page with filtering, search, and sorting capabilities.
A video element captures the user's camera feed in real-time.
A canvas layer overlays the video to render product visualizations.
MediaPipe (or equivalent ML model) runs in a WebWorker to detect key facial points including ears, nose bridge, cheekbones, and neck area.
Detected landmarks are continuously passed back to the main thread for processing.
Product definitions containing size, positioning offsets, and scaling multipliers determine precise placement.
On each animation frame, the module calculates scale, rotation, and position transforms based on facial movement.
Transparent PNG product images are dynamically drawn on the canvas,maintaining accurate positioning during real-time face and head movements.
Category/subcategory selection interface (nosepins, earrings, necklaces,eyewear).
Try-on section featuring snapshot capture with retake and download functionality.
Full-screen mode toggle for enhanced viewing and closer product examination.
Key Features
E-commerce platforms wanting “try before you buy” for jewelry and eyewear
Fashion & accessories websites offering virtual tryon rooms
Social shopping features where users share Araugmented selfies
In-store kiosks or events for contactless product demos
Next.js (version 15.3), React (version 19.0)
TypeScript
Tailwind CSS, Shadcn UI library
MediaPipe (v0.4.1)