How ali-m07/mirrorfit works
MirrorFit is a webcam-based virtual try-on platform, exposed both as a desktop kiosk and an HTTP/WebSocket service. A shopper starts a session, the engine captures frames, estimates and smooths pose, fits a catalog garment, optionally replaces the background, then publishes the composed view; controls also support garment changes, modes, and capture. Session state tracks duration and engagement. The README documents both web demos, studio modes, and image/OBJ garments. Pipeline and route details are supported by sampled source; some API wiring and UI behavior are described by the README rather than inspected source.
Main entry points: tryon_engine.py Try-on engine · routes.py API routes · api_server.py API service · helpers.py Garment catalog
Components 20
User entrypoints
- Kiosk app
main.py - API service
api_server.py - API routes
src/api/routes.py - API schemas
src/api/schemas.py - Browser demo
web/index.html - Streamlit demo
streamlit_app.py
Try-on pipeline
- Try-on engine
src/core/tryon_engine.py - Webcam capture
src/camera/webcam.py - Pose tracking
src/vision/pose_estimator.py - Studio segmentation
src/vision/segmenter.py - Garment renderer
src/vision/clothing_renderer.py - Kiosk overlay
src/ui/overlay.py
Session and catalog
- Session analytics
src/core/session_manager.py - Garment catalog
src/utils/helpers.py - Garment assets
assets/clothes/catalog.json - Runtime configuration
src/utils/config_loader.py
Streaming and capture
- Screenshots and recordings
output
Other components
- Shopper / operator
- Embedded API clients
- Webcam
Connections 24
- Shopper / operator → Kiosk app: controls
- Shopper / operator → Browser demo: uses
- Shopper / operator → Streamlit demo: uses
- Embedded API clients → API service: sends requests
- Browser demo → API service: calls API
- Streamlit demo → API service: calls API
- API service → API routes: dispatches
- API routes → API schemas: uses schemas
- Kiosk app → Try-on engine: controls
- API routes → Try-on engine: controls and queries
- Try-on engine → Webcam capture: reads frames
- Webcam → Webcam capture: provides video
- Try-on engine → Pose tracking: estimates pose
- Try-on engine → Studio segmentation: segments background
- Try-on engine → Garment renderer: renders garment
- Try-on engine → Garment catalog: selects and loads
- Garment catalog → Garment assets: reads assets
- API routes → Garment catalog: updates or reloads
- Try-on engine → Session analytics: tracks session
- Try-on engine → Kiosk overlay: draws kiosk HUD
- Try-on engine → Runtime configuration: uses settings
- Try-on engine → Screenshots and recordings: writes captures
- API routes → Screenshots and recordings: returns capture paths
- Try-on engine → API routes: publishes frames