The Smart Attendance System is a real-time facial recognition-based application designed for educational institutions and organizations to automate the process of attendance tracking. By leveraging computer vision, the system identifies individuals from a camera feed and records their attendance in a CSV file.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- File Structure
- Troubleshooting
- Contributing
- License
- Real-Time Face Recognition: Detects and recognizes faces using a live camera feed.
- Automated Attendance Logging: Records attendance data (name and timestamp) in a CSV file.
- Session Management: Supports starting and stopping attendance sessions.
- Configurable Settings: Easily configure paths for known faces and attendance logs.
- User-Friendly Interface: Simple GUI built with Tkinter for ease of use.
- Multi-Camera Support: Option to select from multiple connected cameras.
- Security: Basic user authentication to restrict access.
- Error Handling: Graceful handling of exceptions and errors during runtime.
Before running the Smart Attendance System, ensure you have the following installed:
- Python 3.x
- pip (Python package manager)
-
Clone the Repository:
git clone https://github.com/your-username/smart-attendance-system.git cd smart-attendance-system
-
Install the Required Packages:
Use the following command to install all necessary Python packages:
pip install -r requirements.txt
-
Set Up Known Faces:
- Create a directory named
known_faces
in the project root. - Add images of known individuals into this directory. Ensure that the file name of each image corresponds to the person’s name (e.g.,
john_doe.jpg
).
- Create a directory named
-
Configuration:
Modify
config.ini
to set paths for the known faces directory and the attendance CSV file. If not provided, default paths will be used.
The application uses a config.ini
file to manage configuration settings. Below is an example configuration:
[Paths]
KNOWN_FACES_DIR = known_faces
ATTENDANCE_CSV_PATH = attendance.csv
[Camera]
CAMERA_INDEX = 0 # Change to 1, 2, etc., if using a different camera
KNOWN_FACES_DIR
: Directory where known faces are stored.ATTENDANCE_CSV_PATH
: Path to the CSV file where attendance will be recorded.CAMERA_INDEX
: Index of the camera to be used. Default is0
.
-
Start the Application:
Run the Python script to launch the GUI:
python attendance_system.py
-
Using the GUI:
- Start Camera: Click "Start Camera" to begin face detection and recognition.
- Stop Camera: Click "Stop Camera" to end the session.
- Attendance Log: The right panel shows a log of recorded attendance.
-
Attendance Log:
Attendance is automatically saved in the specified CSV file (
attendance.csv
by default). Each entry includes the name of the recognized individual and the timestamp of attendance.
The project structure is organized as follows:
smart-attendance-system/
│
├── attendance_system.py # Main application script
├── README.md # Project documentation
├── requirements.txt # Python dependencies
├── config.ini # Configuration file
├── LICENSE # License information
├── .gitignore # Files to be ignored by Git
├── attendance.csv # CSV file for attendance logs. This is an Example file can be generated by own.
Here are some common issues and solutions:
-
Camera Not Working:
- Ensure that your camera is connected properly.
- Check the
CAMERA_INDEX
in theconfig.ini
file and adjust it as necessary.
-
Face Not Recognized:
- Ensure the image in the
known_faces
directory is clear and well-lit. - Try adding more images of the person in different lighting or angles.
- Ensure the image in the
-
Application Freezes:
- This might be due to a heavy processing load. Ensure your system meets the requirements and try lowering the camera resolution.
-
CSV File Not Generated:
- Ensure that you have write permissions to the directory where the CSV file is being saved.
Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.
- Fork the repository.
- Create a new branch:
git checkout -b my-feature-branch
- Make your changes and commit them:
git commit -m 'Add my feature'
- Push to the branch:
git push origin my-feature-branch
- Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for more details.