Logo
All Projects
7 min read
machine-learningpythonopencv

Face Recognition Attendance System

Track classroom or office attendance using real-time face recognition with OpenCV and Python.

Overview

A production-ready attendance system that detects faces from a webcam, recognizes registered users, and logs timestamps to CSV/Excel.

Supports offline usage and works on low-spec laptops.

Features

  • Real-time face detection with Haar cascades
  • Face recognition using LBPH
  • Auto mark in/out with timestamp
  • Duplicate prevention within a grace window
  • CSV and Excel export
  • Admin CLI to register faces

Tech Stack

  • Python 3.10+
  • OpenCV
  • Numpy
  • Pandas

Project Structure

attendance/
├─ data/                # Face datasets and trained model
├─ logs/                # Attendance CSV/Excel
├─ register.py          # Register new faces
├─ train.py             # Train recognizer
├─ run.py               # Start attendance app
└─ requirements.txt

Setup

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Usage

Register at least 30 images per person with unique IDs:

python register.py --person-id 1001 --name "Alice"

Train the model:

python train.py

Run attendance system:

python run.py --export excel

Sample CSV

name,person_id,action,timestamp
Alice,1001,IN,2025-09-01T09:03:11
Alice,1001,OUT,2025-09-01T17:34:22

Notes

  • Ensure good lighting for better recognition accuracy.
  • Re-train the model after adding/removing users.

Share your thoughts

Love to hear from you

Please get in touch with us for inquiries. Whether you have questions or need information. We value your engagement and look forward to assisting you.

Contact Us

Contact us to seek help from us, we will help you as soon as possible

contact@projectmart.in
Send Mail
Customer Service

Contact us to seek help from us, we will help you as soon as possible

+91 7676409450
Text Now

Get in touch

Our friendly team would love to hear from you.