Face Attendance
π Overview
Point a camera at a face and it clocks you in automatically: enroll each person's facial features first, then every time that face appears it logs the name and the check-in time to build an attendance record.
It uses OpenCV with face_recognition (or MediaPipe FaceMesh plus encoding comparison) for feature extraction and matching, and writes the results to a CSV or Excel sheet - the standard approach for a beginner-level face recognition application.
π§° What you need
- Computer + camera (for attendance, mount it in a fixed position)
- Python 3.7+ environment
- pip install: opencv-python, face-recognition (or dlib plus dlib), numpy
- Optional: several photos of each person to build the face database
π§ Step by step
Install the dependencies
face_recognition depends on dlib, which is fiddly to install - follow the official instructions
MediaPipe or OpenCV LBPH are lighter alternatives
Build the face database
Prepare one clear front-facing photo per person
Extract the 128-dimensional face encoding and store it in memory or on disk
Recognise in real time
Detect and encode faces on every camera frame
Compare against the database by distance and treat anything below the threshold as a match
Prevent duplicate check-ins
Remember the last check-in time and ignore the same person within a short window
Keep a dictionary of name to last check-in time
Write the attendance sheet
Write name, time, and date to a CSV
It can be extended into a per-day summary report
On-screen feedback
Draw the face box and show the name and check-in status live
Add a check-mark badge for a more complete experience
π‘ Tips
- The threshold is critical: too loose and it misidentifies, too tight and it misses people - test with several photos and pick a value
- A fixed camera position and even lighting make recognition far more stable
- With several faces in frame, make sure each box maps to the right name to avoid mix-ups