Skip to content

SitanshuA091/FACE-Approval-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

FaceApproval - Facial Recognition + Attendance System

A simple facial recognition attendance system demo built with React, FastAPI, and OpenCV LBPH.

Python React FastAPI


Features

  • Dual Enrollment - Webcam or file upload
  • Real-time Recognition - Automatic attendance marking
  • Live Dashboard - Stats and records
  • Google Sheets - Auto data sync
  • Responsive - Works on all devices

Tech Stack

Frontend: React, Tailwind CSS, React Webcam
Backend: FastAPI, OpenCV (LBPH), Google Sheets API
Algorithm: LBPH (Local Binary Patterns Histograms)


🚀 Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 16+
  • Google Sheets API credentials

Setup

Backend:

cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Frontend:

cd frontend
npm install
npm start

Access: http://localhost:3000

Google Sheets Setup

  • put the google_sheets_creds.json file(downloaded from https://console.cloud.google.com) and store it in a credentials folder in the backend directory and add the required path and spreadsheet ID from google sheets also share the spreadsheet with the service account email created Procedure
    • Click "New Project" → add project name and → Create
    • Enable Google Sheets API from library
    • from API & services -> create credentials -> Service Account and grant editor access after creation
    • from the service account create key in JSON format and create(automatic download to system)

Usage

  1. Enroll - Capture or upload face photo
  2. Approve Entry - Face camera for recognition
  3. Dashboard - View attendance stats

Structure

├── backend/          # FastAPI + OpenCV
│   ├── app/
│   ├── data/
│   └── credentials/
└── frontend/         # React UI
    └── src/

API Endpoints

  • POST /api/enroll/webcam - Enroll from camera
  • POST /api/enroll/file - Enroll from file
  • POST /api/approve - Mark attendance
  • GET /api/dashboard/stats - Get statistics

API Docs: http://localhost:8000/docs


Mechanism

Uses LBPH algorithm for face recognition:

  • Detects faces with Haar Cascade
  • Extracts texture patterns
  • Trains on each enrollment
  • Recognizes faces in real-time

⭐ Demo project for my learning purposes

About

A Facial recognition based web application

Topics

Resources

Stars

Watchers

Forks

Contributors