How nightfury217836/digital-facial-recognisation-attendance-system works
Project Type and Purpose
• This is a full-stack, web-based attendance management system using facial recognition.
• Purpose: automate attendance recording via real-time computer vision and AI; provide an admin dashboard for user and record management.
File Structure
• app.py: main Flask application (HTTP routes, controller logic).
• model.py: facial recognition and ML logic (OpenCV, Mediapipe, RandomForestClassifier).
• static/: client-side assets
• css/style.css
• js/*.js (camera_add_student.js, camera_mark.js, dashboard.js)
• images/
• templates/: Flask Jinja2 HTML views (index, add_student, mark_attendance, attendance_record).
• README.md: describes features, tech stack (Flask, Python, OpenCV, SQLite3, HTML/CSS/JS).
README for Insights
• Architecture hints: browser UI ↔ Flask API ↔ ML model ↔ SQLite database.
• Optional external services: email/SMS APIs.
Main Components & Their Interactions
a. Frontend (Browser)
• Static assets (HTML, CSS, JS) loaded from Flask under /static and /templates
• JS modules capture camera feed, call backend endpoints via AJAX/fetch
b. Backend (Flask app.py)
• HTTP controllers:
– GET / → index.html
– GET/POST /add_student → add_student.html
– GET/POST /mark_attendance → mark_attendance.html
– GET /attendance_record → attendance_record.html
• Calls model.py functions for face detection/recognition
• CRUD operations on SQLite3 via Python DB API
• Optional integration with Email/SMS APIs for notifications
c. ML Model Layer (model.py)
• Uses OpenCV & Mediapipe to preprocess camera frames
• Uses FaceRecognition library and RandomForestClassifier for identity matching
• Exposes functions: enroll_face(user_id), recognize_faces(frame)
d. Database (SQLite3)
• Tables: users (id, name, facial_data), attendance_records (user_id, timestamp, status)
e. (Optional) External Services
• Email/SMS provider APIs for alerts
Architectural Patterns & Design Principles
• MVC-like separation:
• Views: templates/*.html + static assets
• Controllers: Flask routes in app.py
• Model layer: model.py + SQLite
• Modular design: clear separation between face-recognition logic and web server logic.
• Single service deployment: monolithic Flask app, can be containerized or deployed on a VM.
Putting It All Together
• Notes on technologies (Flask, OpenCV, SQLite) next to their components.