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.
- Host: GitHub
- URL: https://github.com/professorlearncode/pixid
- Owner: ProfessorlearnCode
- Created: 2025-06-29T13:18:27.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T13:38:24.000Z (12 months ago)
- Last Synced: 2025-06-29T14:31:05.370Z (12 months ago)
- Language: C++
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.*