How spidy20/attendace_management_system works
Project Type and Purpose
• This is a desktop “Attendance Management System” that uses face recognition
• It combines a GUI front-end (Tkinter) with image processing (OpenCV), data storage (CSV/DB), and a model training pipeline
Main Components
1. User Interface Layer
– AMS_Run.py: the entry point for the Tkinter GUI
– UI Modules:
• “Take Images” screen
• “Train Image” screen
• “Automatic Attendance” screen
• “Manually Fill Attendance” screen
2. Face Data Collection & Storage
– TrainingImage folder: stores raw face images
– StudentDetails.csv: maps IDs ↔ names
3. Model Training Pipeline
– training.py / retrain.py: scripts that read TrainingImage, train the recognizer, output Trainner.yml
– Haarcascade XML files: used by OpenCV for face detection
4. Recognition Engine
– testing.py / code within AMS_Run.py: loads Trainner.yml, uses OpenCV to detect & recognize faces in real time
5. Attendance Management
– Attendance folder: writes CSV files (with timestamp, subject) for each session
– Optional DB Module: MySQL/WAMP server connector in AMS_Run.py stores attendance & student details in a database
6. External Libraries & Resources
– OpenCV, PIL (Pillow), Pandas, Tkinter
Relationships & Data Flows
• User → GUI → triggers:
– “Take Images” → Face Detector → store raw images → update StudentDetails.csv
– “Train Image” → Training Pipeline → produces Trainner.yml
– “Automatic Attendance” → Recognition Engine → writes attendance CSV & updates DB
– “Manually Fill Attendance” → direct CSV/DB write without recognition
• TrainingImage → training.py → Trainner.yml
• Haarcascade XML → used by both data collection and recognition steps
• CSV files and DB: sink for attendance records and student metadata
Architectural Patterns & Principles
• Module Separation:
– UI layer (AMS_Run.py)
– Data layer (file storage, CSV, DB)
– Business logic layer (face detection, training, recognition)
• Resource Reuse: Haarcascade XML files shared by both data collection and recognition
• Extensibility Points:
– Swap recognizer algorithm (update training.py)
– Change DB backend in AMS_Run.py