How devasy23/facerec works
Project type and purpose
• This is a full‑stack face recognition application.
• Purpose: provide a web UI (Flask) for users to register, update, delete, and view face entries, backed by a FastAPI service that handles image processing (DeepFace), embedding extraction, and CRUD operations in MongoDB.
• Offline “Model‑Training” notebooks/scripts train and evaluate embedding models; a pre‑trained model is stored under Model/.
File structure
• Top‑level directories:
• API/ – the FastAPI service code, routes, DB connector, utilities
• FaceRec/ – the Flask application, static assets, HTML templates
• Model‑Training/ – Jupyter notebooks and Python scripts for training and evaluation
• Model/ – pretrained embedding model
• testing/ – pytest tests for API endpoints and database logic
• docs/ – Sphinx documentation
• Key files:
• main.py – entry point that spins up both Flask and FastAPI apps
• requirements.txt – combined dependencies (Flask, FastAPI, DeepFace, pymongo, etc.)
• API/database.py – MongoDB connection setup
• API/route.py – FastAPI endpoints for create/read/update/delete operations
• CI/CD and quality: .github/workflows, .gitlab-ci.yml, sonar-config, pre‑commit hooks.
README for additional insights
• Describes real‑time recognition via DeepFace, metadata management, and scalable architecture.
• Lists function flows (create_new_faceEntry, Data, update, read, delete).
• Database schema for faceEntries collection.
Essential architectural elements
1) UI lane (Browser ↔ Flask)
2) Backend lane (Flask ↔ FastAPI ↔ DeepFace ↔ MongoDB)
• Test suite as a note, showing “testing/” hitting API endpoints (optional)