A modern, efficient, and contactless attendance management system that uses facial recognition to automatically track attendance. This system eliminates the need for traditional attendance methods and provides a seamless experience for both administrators and users.
- Facial Recognition: Automatically identifies registered individuals using advanced facial recognition algorithms
- Real-time Tracking: Instantly detects and recognizes faces in the camera feed
- Automatic Attendance Logging: Saves attendance records with timestamps in CSV format
- User-friendly Interface: Simple and intuitive UI with visual feedback
- Easy Registration: Quick process to add new faces to the database
- Privacy-focused: All data is stored locally, ensuring privacy and data security
- Python 3.6+
- Webcam or camera device
- Dependencies listed in
requirements.txt
├── assets # Images and other static assets
├── attendance # Attendance records (CSV files)
├── data # Face data and model files
│ ├── names.pkl # Stored names for recognition
│ ├── face_data.pkl # Facial features data
│ └── haarcascade_frontalface_default.xml # Face detection model
├── src # Source code
│ ├── main.py # Main application entry point
│ ├── dataset.py # Data collection functionality
│ ├── constants.py # Configuration and constants
│ └── util_functions.py # Utility functions
├── README.md # Project documentation (this file)
└── requirements.txt # Project dependencies
-
Clone this repository:
git clone https://github.com/Chaimaaorg/AttendAI.git cd face-recognition-attendance
-
Install dependencies:
pip install -r requirements.txt
-
Make sure the
data
directory contains the required files or run the dataset collection first.
Run the dataset collection script to register new faces:
python src/dataset.py
Follow the prompts to:
- Enter your name
- Allow the system to capture multiple face samples
- Stay still and ensure proper lighting for best results
- Press 'q' to quit after sufficient samples are collected
Start the main application:
python src/main.py
- The system will automatically detect and recognize registered faces
- Press 'o' to mark attendance for the detected person
- Press 'q' to quit the application
Attendance records are saved in the attendance
directory as CSV files with the naming format Attendance_DD-MM-YYYY.csv
. Each file contains:
- Name of the individual
- Timestamp of attendance
- Face Detection: Uses Haar Cascade classifier to detect faces in the video feed
- Feature Extraction: Processes detected faces to extract key features
- Classification: Uses K-Nearest Neighbors algorithm to match faces against the database
- Attendance Logging: Records attendance with timestamps in CSV format
You can modify the following parameters in constants.py
:
- Frame dimensions and positions
- Color schemes
- Sample frequency for data collection
- Maximum number of face samples to collect
- And more...
- No Face Detected: Ensure proper lighting conditions and face positioning
- Misidentification: Collect more samples with various expressions and angles
- Camera Issues: Check your camera connection and permissions
-
Implement deep learning-based facial recognition (e.g., using FaceNet or OpenFace). I may add some notebooks related to this project. Check out my Kaggle profile: Kaggle Profile
-
Improve recognition accuracy under varying lighting conditions.
-
Integrate with a database for centralized attendance tracking.
Contributions are welcome! Please feel free to submit a Pull Request.