AI-powered face recognition attendance system.
Register students once. Mark attendance automatically. Export instantly.
Features · Demo · Installation · Usage · Tech Stack
ClassScan is a web-based attendance management system that uses face recognition to automatically identify students from classroom photos and generate attendance reports as downloadable CSV files.
Faculty takes a few photos of the class from different angles, uploads them to the system, and within minutes a complete attendance sheet — with every student marked present or absent — is ready to download.
- Multi-photo Registration — Students register using 5–10 photos for maximum recognition accuracy across different angles and lighting conditions
- Live Camera Capture — Students can take selfies directly in the browser without uploading files
- Batch Attendance Processing — Faculty uploads multiple class photos; results are merged automatically, eliminating duplicates
- Instant CSV Export — Attendance report downloads automatically with roll number, name, status, time, and date
- Student Dashboard — View all registered students with registration details
- Database Management — Clear student database or attendance records independently with confirmation prompts
- Fully Local — No cloud, no external APIs, no data leaves your machine
http://localhost:5000/ → Home Dashboard
http://localhost:5000/register → Student Registration
http://localhost:5000/attendance → Take Attendance
http://localhost:5000/students → View All Students
| Roll No | Name | Status | Time | Date |
|---|---|---|---|---|
| 101 | Garry Singh | P | 09:32 | 2026-03-20 |
| 102 | RDJ Kumar | P | 09:32 | 2026-03-20 |
| 103 | Jack Sharma | A | - | 2026-03-20 |
REGISTRATION
────────────
Student opens /register
↓
Takes 5–10 selfies via browser camera
↓
DeepFace generates face embeddings (128 numbers per photo)
↓
Embeddings are averaged → one unified face signature
↓
Saved to local JSON database
ATTENDANCE
──────────
Faculty uploads 3–5 class photos from different angles
↓
System detects all faces in each photo
↓
Each face is encoded → compared against database
↓
Closest match below threshold → marked PRESENT
No match found → marked ABSENT
↓
Results merged across all photos (no duplicates)
↓
CSV downloaded automatically
| Layer | Technology |
|---|---|
| Language | Python 3.11 |
| Web Framework | Flask |
| Face Recognition | DeepFace (Facenet model) |
| Image Processing | OpenCV |
| ML Backend | TensorFlow / Keras |
| Database | JSON (local file) |
| Frontend | HTML, CSS, Vanilla JS |
| Camera Access | WebRTC (browser native) |
- Python 3.11
- pip
- Git
- A webcam or phone camera
1. Clone the repository
git clone https://github.com/yourusername/ClassScan.git
cd ClassScan2. Create virtual environment
py -3.11 -m venv attendance_env
attendance_env\Scripts\activate # Windows
source attendance_env/bin/activate # Mac/Linux3. Install dependencies
pip install -r requirements.txt
⚠️ First install may take 5–10 minutes. DeepFace downloads the Facenet model (~90MB) on first run.
4. Create required folders
mkdir dataset encodings attendance static\uploads templates5. Run the app
python app.py6. Open in browser
http://localhost:5000
- Go to
/register - Enter student name and roll number
- Click Open Camera and take 5–10 selfies
- Click Register Student
- Student is now in the system
💡 More photos = better accuracy. Vary angles and expressions.
- Faculty takes 3–5 photos of the classroom from different angles
- Go to
/attendance - Upload all class photos
- Click Process Attendance
- CSV downloads automatically
- View all registered students at
/students - Clear Database — removes all student registrations
- Clear Attendance — removes all generated CSV files
ClassScan/
│
├── app.py ← Flask web application
├── register.py ← Student registration logic
├── recognize.py ← Face recognition + attendance logic
├── utils.py ← Shared database utilities
├── requirements.txt ← Python dependencies
│
├── templates/
│ ├── index.html ← Home page
│ ├── register.html ← Registration form with camera
│ ├── attendance.html ← Attendance upload form
│ └── students.html ← Student management dashboard
│
├── static/
│ └── uploads/ ← Temporary uploaded files
│
├── dataset/ ← Student registration photos
│ └── {roll_no}/ ← One folder per student
│
├── encodings/
│ └── database.json ← Face embeddings database
│
└── attendance/ ← Generated attendance CSV files
You can adjust recognition sensitivity in recognize.py:
# Lower = stricter matching (fewer false positives)
# Higher = more lenient matching (fewer missed detections)
THRESHOLD = 10Recommended values:
8–10— High accuracy environment (controlled lighting)10–12— Normal classroom environment12–15— Low light or varied angles
- All data is stored locally on your machine. Nothing is uploaded to any server.
- Student photos in
dataset/andencodings/database.jsoncontain biometric data. Do not share or commit these files. - The
.gitignoreexcludes all sensitive data by default.
flask
deepface
opencv-python
numpy
tf-keras
werkzeug
MIT License — feel free to use, modify and distribute.
Built with Python · DeepFace · Flask