An open API service indexing awesome lists of open source software.

https://github.com/professorlearncode/pixid

pixID โ€“ Offline smart attendance system using ESP32-S3 CAM and local face recognition. Built with Flask, runs offline, and supports IR-based gesture capture.
https://github.com/professorlearncode/pixid

Last synced: 12 months ago
JSON representation

pixID โ€“ Offline smart attendance system using ESP32-S3 CAM and local face recognition. Built with Flask, runs offline, and supports IR-based gesture capture.

Awesome Lists containing this project

README

          

# ๐Ÿ“ธ pixID โ€“ Smart Offline Facial Recognition Attendance System

**pixID** is a lightweight, offline-capable attendance system that uses facial recognition, built using the **ESP32-S3 CAM** and a local **Flask server**. Designed with minimal hardware and no reliance on cloud services, itโ€™s perfect for classroom, lab, or small office environments.

---

## ๐ŸŽฏ Project Objective

To create a **smart, secure, and offline-first facial recognition system** that:
- Automatically logs attendance using facial data
- Works without internet access
- Is cost-effective and hardware-friendly
- Can later sync with cloud-based systems

---

## ๐Ÿง  How It Works

1. **ESP32-S3 CAM** acts as a Wi-Fi access point.
2. When triggered (manually or by IR sensor), it captures a face image and sends it to a local server.
3. A **Flask backend**:
- Processes the image
- Matches it with known faces using `face_recognition` (Python)
- Logs attendance in a CSV file
- Updates a simple web dashboard
4. LED feedback on the ESP32 provides status cues.

---

## ๐Ÿš€ Features

- ๐Ÿ”’ **Offline support** (no internet required after setup)
- ๐ŸŽž๏ธ Face capture via `/capture` endpoint or IR gesture
- ๐Ÿง  Local face recognition using Python + `face_recognition`
- ๐Ÿงพ Attendance logged in `attendance_log.csv`
- ๐Ÿ–ฅ๏ธ Web dashboard to view attendance records
- ๐Ÿ’ก LED status indicator (capturing / success / failure)
- ๐Ÿ”Œ Powered via standard 12V laptop adapter

---

## ๐Ÿ“ฆ Tech Stack

| Component | Tech Used |
|----------------|---------------------------------|
| Camera Board | ESP32-S3 CAM |
| Server Backend | Flask (Python) |
| Recognition | `DeepFace` (ArcFace) |
| Communication | HTTP (image POST to Flask) |
| Storage | CSV log, local known_faces DB |
| Triggering | Manual + IR gesture-based |

---

## ๐Ÿ“ Project Structure

```

app/
โ”œโ”€โ”€ app.py โ† Main Flask server
โ”œโ”€โ”€ data/
โ”‚ โ”œโ”€โ”€ embeds/ โ† Eembeddings.pkl
โ”‚ โ”œโ”€โ”€ imgDataset โ† Training images
โ”‚ โ”‚ โ””โ”€โ”€ known_faces/ โ† Original photo records
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ person1/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ person2/
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ person3/
โ”‚ โ”œโ”€โ”€ logs/ โ† Attendance CSV file
โ”‚ โ””โ”€โ”€ processed/ โ† Original photo records
โ”œโ”€โ”€ templates/ โ† Frontend HTML pages
โ”œโ”€โ”€ static/ โ† CSS & JS assets
โ”œโ”€โ”€ uploads/ โ† Enhanced images for recognition
โ”œโ”€โ”€ images/ โ† Raw images from ESP32
โ”œโ”€โ”€ utils/
โ”‚ โ””โ”€โ”€ prepare_embeds.py โ† Use this after adding new known faces
โ”œโ”€โ”€ requirements.txt

````

---

## ๐Ÿงช Setup Instructions

### 1. ๐Ÿ”ง ESP32 Setup

- Flash the ESP32-S3 CAM with `pixid_cam_code.ino`
- Ensure it:
- Creates a SoftAP network
- Runs a `/capture` route
- Takes and POSTs images to Flask server

### 2. ๐Ÿง  Flask Server Setup

```bash
git clone https://github.com/yourusername/pixID.git
cd pixID/server

# Create virtual environment (optional)
python -m venv venv
source venv/bin/activate # For Windows: venv\Scripts\activate

# Install dependencies
pip install -r ../requirements.txt

# Run server
python app.py
````

Server will listen at `http://192.168.4.1:5000` (ESP32โ€™s network)

---

### 3. ๐Ÿ“‚ Enroll Faces

* Add clear, front-facing images in `imgdataset/known_faces/`
* Filenames will be used as (e.g., `1.jpg` โ†’ "in /Farzam")

---

### 4. ๐ŸŽฏ Trigger Attendance Capture

* Connect to ESP32 Wi-Fi
* Visit `http://192.168.4.1/capture` to trigger capture manually
* IR-based gesture capture also supported (customizable in `.ino` file)

---

## ๐Ÿ“Š Dashboard

* Flask hosts a basic web dashboard at `/dashboard`
* View recent attendance records with timestamps

---

## ๐Ÿ“ Notes

* No cloud service used โ€” all computation and logging are local
* You can later integrate cloud sync (e.g., Firebase or Google Sheets API)
* Recognition is best with clear, evenly lit faces from front view
* IR sensor is optional but adds hands-free interaction

---

## ๐Ÿ”ฎ Future Plans

* Add real-time face detection on ESP32 preview
* Implement cloud-based sync (Firebase or S3)
* Optimize power usage (deep sleep cycles)
* Add mobile-friendly dashboard

---

## ๐Ÿ™Œ Acknowledgements

* Inspired by CS50, AI, and IoT coursework
* Built with โค๏ธ by Farzam Asad as an exploration into practical AI + embedded systems

---

> *pixID is a proof-of-concept project for learning, exploration, and showcasing embedded + AI integration.*