https://github.com/arghyadevs/attendaface
AttendaFace is a Python-based desktop application that uses OpenCV and LBPH face recognition to automate attendance tracking in classrooms, offices, or events. The application features a modern GUI with photo-based face registration, real-time recognition, attendance logging, and CSV export.
https://github.com/arghyadevs/attendaface
opencv opencvlbph pillow yml
Last synced: 2 months ago
JSON representation
AttendaFace is a Python-based desktop application that uses OpenCV and LBPH face recognition to automate attendance tracking in classrooms, offices, or events. The application features a modern GUI with photo-based face registration, real-time recognition, attendance logging, and CSV export.
- Host: GitHub
- URL: https://github.com/arghyadevs/attendaface
- Owner: Arghyadevs
- License: mit
- Created: 2025-06-26T14:24:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-26T14:37:21.000Z (about 1 year ago)
- Last Synced: 2025-07-02T13:10:50.891Z (about 1 year ago)
- Topics: opencv, opencvlbph, pillow, yml
- Language: Python
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ธ AttendaFace - Face Recognition Attendance System
**AttendaFace** is a Python-based desktop application that uses **OpenCV** and **LBPH face recognition** to automate attendance tracking in classrooms, offices, or events. The application features a modern GUI with photo-based face registration, real-time recognition, attendance logging, and CSV export.
---
## ๐ Features
- ๐ง **Real-time Face Recognition** using webcam
- ๐ **LBPH Model Training & Persistence**
- ๐ผ๏ธ **Add New Faces** with a photo
- ๐ **CSV Export** of attendance data
- ๐ **No Duplicate Attendance** for the same person on the same day
- ๐ฅ๏ธ **Modern GUI** using Tkinter
- ๐ **Live Stats** for Registered Users and Today's Attendance
- ๐ Stores face data locally with a labeled directory structure
---
## ๐ ๏ธ Tech Stack
| Component | Technology |
|------------------|----------------------------|
| GUI | Tkinter |
| Face Detection | OpenCV Haar Cascades |
| Face Recognition | OpenCV LBPH Face Recognizer|
| Image Handling | Pillow (PIL) |
| File Storage | CSV and Local Filesystem |
| Model Saving | `.yml` and `.pkl` files |
---
## ๐ Folder Structure
```
AttendaFace/
โโโ attend.py # Main application
โโโ face_model.yml # Trained face recognition model
โโโ label_names.pkl # Pickled name-label mappings
โโโ faces_db/ # Directory of registered user face images
โ โโโ Alice/
โ โ โโโ face_1.png
โ โโโ Bob/
โ โโโ face_1.png
โโโ attendance.csv # Optional exported attendance log
โโโ README.md # Project documentation
```
---
## โ๏ธ Installation
### 1. Clone the Repository
```bash
git clone https://github.com/dipenginedev7/AttendaFace.git
cd AttendaFace
```
### 2. Install Requirements
Install the required Python packages:
```bash
pip install opencv-python opencv-contrib-python pillow
```
> ๐ก `opencv-contrib-python` is required to access `cv2.face.LBPHFaceRecognizer_create`.
---
## โถ๏ธ Run the Application
```bash
python attend.py
```
The app will launch a GUI with buttons to start/stop the camera, register new users, and export attendance records.
---
## ๐ค Register a New Person
1. Type the person's name in the "Name" field.
2. Click "Add Photo" and select a front-facing image.
3. The app detects and stores the face, updating the model automatically.
4. Youโll receive a confirmation message upon successful registration.
---
## ๐งพ Attendance Logging
- Launch the camera by clicking "Start Camera".
- When a registered face is recognized:
- Name, Date, and Time are logged.
- Duplicate entries are prevented for the same day.
- Click "Export CSV" to save attendance records.
**CSV Format Example:**
```csv
name,date,time,status
Alice,2025-06-26,10:05:23,Present
Bob,2025-06-26,10:12:01,Present
```
---
## ๐ GUI Stats
At the bottom of the control panel, the GUI shows:
- **Registered:** Total registered users
- **Today:** Attendance count for today
---
## ๐งฉ Future Roadmap
- Webcam-based face registration
- Face dataset augmentation
- Role-based access or admin login
- Calendar-based attendance filtering
- Cloud/DB integration (SQLite, Firebase, etc.)
- Export as Excel or PDF
---
## ๐งฐ Troubleshooting
- **"cv2.face" module not found?**
- Make sure you installed `opencv-contrib-python` and not just `opencv-python`.
- **Face not detected during registration?**
- Ensure the image is well-lit, clear, and front-facing.
- **GUI not launching?**
- Ensure you're running Python 3 and all dependencies are installed.
---
## ๐ License
This project is licensed under the MIT License.
Feel free to use, modify, and distribute it with attribution.
---
## ๐ Acknowledgements
- OpenCV
- Pillow
- The Python community ๐
Built with ๐ป Python and a vision to modernize attendance systems.