How souvikkundu0901/ai-face-analyzer works
AI Face Analyzer is a FastAPI service that turns an uploaded selfie into quality-checked facial and skin metrics, deterministic recommendations, visual output, and a safety-constrained explanation report. The principal workflow is orchestrated in app/main.py; README documents its analysis stages, while sampled code confirms rules-to-LLM ownership. Authenticated users can retain derived scan data, compare scans over time, and manage accounts. The repository also documents a web interface and operational health/observability features. Some pipeline wiring and UI implementation were not sampled, so uncertain links are omitted.
Main entry points: main.py FastAPI service · client.py Explanation generator · dependencies.py Auth dependencies · session.py Database sessions
Components 21
Selfie analysis
- FastAPI service
app/main.py - Quality gate
app/pipeline/quality.py - Face landmarks
app/pipeline/face_detect.py - Geometry metrics
app/pipeline/geometry.py - Skin metrics
app/pipeline/skin.py - Visual overlays
app/pipeline/overlay.py
Recommendations and reports
- Recommendation rules
app/rules/engine.py - Explanation generator
app/llm/client.py - Analysis response
app/schemas.py
Accounts and history
- Auth and tokens
app/auth/security.py - Auth dependencies
app/auth/dependencies.py - Database sessions
app/db/session.py - User and scans
app/db/models.py - Scan comparison
app/comparison/service.py
Security and operations
- Upload validation
app/security/validation.py - Rate limiting
app/security/rate_limiter.py - Metrics collector
app/monitoring/metrics.py - Health and probes
app/main.py
Other components
- Selfie user
- Gemini API
- Web interface
static/index.html
Connections 22
- Selfie user → FastAPI service: uploads selfie
- FastAPI service → Upload validation: validates upload
- FastAPI service → Quality gate: checks quality
- FastAPI service → Face landmarks: detects face
- FastAPI service → Geometry metrics: analyzes geometry
- FastAPI service → Skin metrics: analyzes skin
- FastAPI service → Visual overlays: builds overlays
- FastAPI service → Recommendation rules: evaluates scores
- FastAPI service → Explanation generator: requests explanation
- Explanation generator → Gemini API: calls
- Explanation generator → Analysis response: returns explanation
- FastAPI service → Analysis response: returns analysis
- Web interface → FastAPI service: uses API
- FastAPI service → Auth dependencies: checks identity
- Auth dependencies → Auth and tokens: validates tokens
- FastAPI service → Auth and tokens: issues tokens
- FastAPI service → Database sessions: opens sessions
- Database sessions → User and scans: persists records
- FastAPI service → Scan comparison: compares scans
- FastAPI service → Rate limiting: throttles requests
- FastAPI service → Metrics collector: records timings
- FastAPI service → Health and probes: serves probes