Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 SnapRoll | AI-Powered Attendance System

One photo. One voice clip. Zero roll calls.

Python 3.10+ Streamlit Supabase dlib scikit-learn PyTorch

Deployed on Streamlit License: MIT PRs Welcome Status


SnapRoll is a production-grade, AI-driven classroom management system that automates attendance logging using facial recognition and voice biometric verification. It replaces tedious manual roll calls with automated photo and audio scanning, logging timestamped records in real time.

πŸš€ Live Demo Β· πŸ“– Quickstart Β· πŸ—„οΈ Database Setup Β· πŸ› Report Bug



πŸ“‹ Table of Contents


✨ Key Features

πŸ“Έ Multi-Angle AI Face Attendance

  • Parallel Scanning: Processes single or multiple classroom photos simultaneously.
  • Biometric Embeddings: Extracts 128-dimensional facial embeddings using dlib HOG face detection and 68-point shape landmark alignment.
  • SVM Classifier: Uses a Support Vector Machine (SVM) classifier trained dynamically on enrolled student profiles for instant multi-face verification.

πŸŽ™οΈ Speaker Segmentation Voice Attendance

  • Audio Processing: Captures classroom speech clips directly via browser microphone input.
  • Speaker Diarization & Embeddings: Uses librosa for voice segment processing and Resemblyzer for generating 256-dimensional neural voice embeddings.
  • Cosine Distance Matching: Matches audio signatures against enrolled voice profiles using cosine similarity metrics with automated thresholding.

πŸ“š Subject & Auto-Enrollment System

  • Instant Join Links & QR Codes: Auto-generates shareable links and downloadable QR codes (powered by segno) for seamless student self-enrollment.
  • Role Routing: Role-aware interface for Teachers (class management, AI scans, logs) and Students (Face ID login, subject dashboard, personal attendance history).

πŸ“Š Interactive Analytics & Export

  • Roster Inspection: Interactive summary table allowing teachers to click any session row to inspect complete student attendance rosters.
  • CSV Export: One-click report download with formatted timestamps for administration compliance.

πŸ— System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                            STREAMLIT FRONTEND LAYER                         β”‚
β”‚       Role-Aware UI (Home Router β†’ Teacher Dashboard / Student Portal)      β”‚
β”‚         Browser Camera Capture Β· Audio Recorder Β· Interactive Tables        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                            AI PIPELINE LAYER                                β”‚
β”‚                                                                             β”‚
β”‚   πŸ“· Face Pipeline                       πŸŽ™οΈ Voice Pipeline                 β”‚
β”‚   β”œβ”€β”€ dlib HOG Face Detector             β”œβ”€β”€ librosa Audio Segmentation     β”‚
β”‚   β”œβ”€β”€ 68-Point Shape Predictor           β”œβ”€β”€ Resemblyzer Voice Embedder     β”‚
β”‚   β”œβ”€β”€ 128-d Embedding Extraction         β”œβ”€β”€ 256-d Vector Normalization     β”‚
β”‚   └── scikit-learn SVM Classification    └── Cosine Similarity Matcher      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ Supabase Client (REST / Realtime)
                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                             DATA LAYER (Supabase)                           β”‚
β”‚                PostgreSQL Relational DB (RLS Configured)                    β”‚
β”‚     teachers Β· students Β· subjects Β· subject_students Β· attendance_logs     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ›  Tech Stack

Domain Technology Description
Core Framework Python 3.10+ Primary language runtime
Web UI Streamlit Responsive single-page web framework
Face Biometrics dlib, face_recognition_models HOG face detector & 128-d facial landmark extractors
Voice Biometrics Resemblyzer, librosa, torch Voice encoder & audio segmentation engine
Machine Learning scikit-learn, numpy, pandas SVM classification and tabular dataset manipulation
Authentication bcrypt Hashed password verification for instructor accounts
Database Supabase (PostgreSQL) Cloud database layer with REST endpoint access
QR Code Engine segno Vector QR code generator for subject join links

πŸ“ Project Directory Structure

snaproll-ai-powered-attendance-system/
β”œβ”€β”€ .streamlit/
β”‚   └── secrets.toml                   # Streamlit credentials (SUPABASE_URL, SUPABASE_KEY)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/                    # UI Components & Modal Dialogs
β”‚   β”‚   β”œβ”€β”€ dialog_add_photos.py       # Camera & image file uploader
β”‚   β”‚   β”œβ”€β”€ dialog_attendance_result.py# Attendance report preview modal
β”‚   β”‚   β”œβ”€β”€ dialog_auto_enroll.py      # QR / link quick enrollment handler
β”‚   β”‚   β”œβ”€β”€ dialog_create_subject.py   # Subject creation form
β”‚   β”‚   β”œβ”€β”€ dialog_enroll.py          # Manual subject code enrollment modal
β”‚   β”‚   β”œβ”€β”€ dialog_share_subject.py   # QR code generator & link launcher
β”‚   β”‚   β”œβ”€β”€ dialog_voice_attendance.py # Voice recording & recognition modal
β”‚   β”‚   β”œβ”€β”€ footer.py                  # Page footer layout
β”‚   β”‚   β”œβ”€β”€ header.py                  # Top banner header component
β”‚   β”‚   └── subject_card.py            # Subject statistics card widget
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ config.py                  # Supabase client instantiation
β”‚   β”‚   └── db.py                      # Data access layer (CRUD queries & joins)
β”‚   β”œβ”€β”€ pipelines/
β”‚   β”‚   β”œβ”€β”€ face_pipeline.py           # Face detection, 128-d embedding & SVM model
β”‚   β”‚   └── voice_pipeline.py          # Voice segmentation & Resemblyzer embedding match
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ home_screen.py             # Landing page / portal selection
β”‚   β”‚   β”œβ”€β”€ student_screen.py          # Student dashboard & Face ID login flow
β”‚   β”‚   └── teacher_screen.py          # Teacher dashboard, attendance session & records
β”‚   └── ui/
β”‚       └── base_layout.py             # CSS styling injection & typography config
β”œβ”€β”€ assets/
β”‚   └── SnapRoll_Logo.ico             # Application icon asset
β”œβ”€β”€ app.py                             # Main entry point & session state router
β”œβ”€β”€ requirements.txt                   # Dependency manifest
└── README.md                          # Production documentation

βš™οΈ Quickstart & Installation

Prerequisites

  • Python: Version 3.10 or higher
  • Git: Installed on system path
  • Compiler Tools: C++ build tools (for dlib compilation if binary wheel is not available)

Step 1: Clone Repository

git clone https://github.com/Vaibhav1o1/snaproll-ai-powered-attendance-system.git
cd snaproll-ai-powered-attendance-system

Step 2: Set Up Virtual Environment

Windows (PowerShell):

python -m venv venv
.\venv\Scripts\Activate.ps1

macOS / Linux:

python3 -m venv venv
source venv/bin/activate

Step 3: Install Dependencies

pip install --upgrade pip
pip install -r requirements.txt

πŸ”‘ Environment Configuration

Create a .streamlit/secrets.toml file inside the root folder:

# .streamlit/secrets.toml
SUPABASE_URL = "https://your-project-id.supabase.co"
SUPABASE_KEY = "your-supabase-anon-key"

(Alternatively, you can create a .env file with SUPABASE_URL and SUPABASE_KEY variables).

Launching Application

streamlit run app.py

The application will start locally at http://localhost:8501.


πŸš€ Production Deployment

Deploying to Streamlit Community Cloud

  1. Push your latest codebase to GitHub (ensure .streamlit/secrets.toml is listed in .gitignore).
  2. Log into share.streamlit.io with GitHub.
  3. Select New App β†’ Select your repository, set branch to main, and set main file path to app.py.
  4. Open Advanced Settings β†’ Secrets and paste your credentials:
    SUPABASE_URL = "https://your-project-id.supabase.co"
    SUPABASE_KEY = "your-supabase-anon-key"
  5. Click Deploy!

πŸ”­ Future Roadmap

  • πŸ“± Native Mobile Interface: Responsive mobile-first view optimized for smartphone cameras.
  • πŸ“ˆ Defaulter Analytics: Automated risk indicator reports for students falling below minimum attendance thresholds.
  • πŸ”” Webhooks & Email Alerts: Real-time notification dispatch via SendGrid/Twilio.
  • 🧠 Multi-Angle Face Alignment: Integration of RetinaFace for improved recognition under low lighting.

🀝 Contributing

Contributions are welcome! Follow these steps:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/amazing-feature.
  3. Commit your changes: git commit -m 'Add amazing feature'.
  4. Push to branch: git push origin feature/amazing-feature.
  5. Open a Pull Request.

πŸ“œ License

Distributed under the MIT License. See LICENSE for more information.


** Built for Modern Educators**

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages