How dev-mir2011/facial-recognition works
Facial Recognition is a Flask web application for registering people from face images and identifying submitted images against those registrations. The main workflow is camera capture or upload, API validation and face detection, then registration or ArcFace comparison, with a result returned to the browser. The application also provides login-protected admin views and APIs for registered faces and event logs, plus public health and statistics endpoints. The README documents the model workflow; unsampled templates and route wiring are represented only where supported by the tree or sampled code.
Main entry points: api.py API routes · templates Browser UI · app.py Flask app · login.py Login routes
Components 20
Web interface
- Browser UI
templates - Registration UI
static/js/register.js - Recognition UI
static/js/recognize.js - Home dashboard
static/js/home.js
Flask application
- Flask app
app.py - Page routes
routes/frontend.py - API routes
routes/api.py - Login routes
routes/login.py
Face processing
- Upload validation
utils/validation.py - Face detection
utils/recognition.py - Face matching
utils/recognition.py - Image file operations
utils/files.py - Image files
routes/api.py
Administration and records
- Registered people
utils/recognition.py - Event logs
utils/log.py - Log access
utils/log.py - Admin records
routes/login.py - Session user
utils/users.py
Other components
- Visitor
- DeepFace ArcFace
Connections 30
- Visitor → Browser UI: uses
- Browser UI → Page routes: requests pages
- Flask app → Page routes: registers routes
- Flask app → API routes: registers routes
- Flask app → Login routes: registers routes
- Flask app → Session user: loads session user
- Page routes → Browser UI: renders templates
- Browser UI → Registration UI: loads script
- Browser UI → Recognition UI: loads script
- Browser UI → Home dashboard: loads script
- Registration UI → API routes: posts registration
- Recognition UI → API routes: posts image
- Home dashboard → API routes: fetches stats
- API routes → Upload validation: checks extension
- API routes → Face detection: checks face
- API routes → Face matching: requests match
- Face detection → DeepFace ArcFace: extracts faces
- Face matching → DeepFace ArcFace: verifies images
- Face matching → Registered people: reads references
- API routes → Registered people: writes registrations
- API routes → Image files: saves uploads
- API routes → Image file operations: cleans images
- API routes → Log access: records events
- API routes → Log access: gets logs
- Log access → Event logs: reads and writes
- API routes → Event logs: reads people data
- Login routes → Admin records: checks credentials
- Login routes → Session user: creates session user
- API routes → Admin records: resolves admin name
- API routes → Browser UI: returns API response