How sharmaji27/face-recognition-based-attendance-system works
Project type and purpose
• This is a lightweight full-stack web application for automated attendance tracking using face recognition.
• The user visits a web page, the system captures a live camera feed, detects and recognizes faces, and records attendance.
File structure
• Top-level files:
• app.py – the main Flask application, routes, and orchestration
• haarcascade_frontalface_default.xml – OpenCV face-detection model
• README.md – high-level description
• templates/home.html – frontend UI served by Flask
README for additional insights
• No explicit database schema called out, but screenshot implies real-time detection UI.
• Likely stores attendance in CSV or simple SQLite (we’ll show “Data Storage” as a component).
Main components and interactions
a. Client (Web Browser)
– Renders home.html, streams video via JavaScript or HTML5 canvas
– Sends “start capture” requests to Flask
b. Web Server (Flask app.py)
– Route “/” serves UI
– Route “/recognize” handles video frames or image uploads
– Orchestrates face detection & recognition workflows
c. Face Detection Module (OpenCV + haarcascade)
d. Face Recognition Module (e.g. LBPH or FaceNet)
– Compares detected faces against known embeddings
e. Attendance Manager
– Applies business rules: timestamp, duplicate checks
f. Data Storage
– CSV file or SQLite database containing “user_id, name, timestamp”
g. Hardware & External Dependencies
– Webcam or camera feed
– OpenCV library
Data Flow:
1. Browser → Flask “/recognize” (frame/image)
2. Flask → Detection Module → face coordinates
3. Flask → Recognition Module → match ID
4. Recognition result → Attendance Manager → Data Storage
5. Flask → Browser (current attendance view/confirmation)
Architectural patterns & design principles
• Monolithic MVC:
• Model = Data Storage
• View = home.html
• Controller = Flask routes + manager code
• Separation of concerns: detection vs. recognition vs. data management