A high-performance classroom attendance system leveraging an edge-optimized edge-cloud architecture. It utilizes YOLOv8 ByteTrack for hyper-fast spatial person tracking and Face_Recognition + Cosine Similarity for resilient frame-buffered identification.
This project integrates a React frontend, a Node.js backend gateway, and a highly-threaded FastAPI machine learning core for zero-lag surveillance edge cameras.
/frontend: React + Vite dashboard for Faculty and Students./backend: Node.js + Express API gateway handling Supabase integrations./ml-core: FastAPI Neural Vision Server housing theTrackedAttendancePipeline.- Zero-lag Threading: Camera multi-threading dynamically drops old frames preventing buffer lock.
- ByteTrack State Engine: Uses YOLO
persist=Trueto carry rigid integer IDs across occlusions, preventing ID-switching. - Frame Consensus: Demands 3 concurrent Cosine Similarity face-hits (
> 0.45threshold) before a tracked face is securely sent to the API.
- Node.js (v18+)
- Python (3.8+)
- Supabase Account
Copy .env.example to the subsequent directories and fill in your Supabase credentials:
backend/.envml-core/.env
Backend:
cd backend
npm installFrontend:
cd frontend
npm installML Core:
# Create a virtual environment in the project root
python -m venv .venv
source .venv/Scripts/activate # Windows: .venv\Scripts\activate
cd ml-core
pip install -r requirements.txtStart the components in parallel:
- Backend:
cd backend && npm run dev - Frontend:
cd frontend && npm run dev - ML Vision Server: Run directly to spool up the web-socket server:
cd ml-core && python vision_server.py(Alternatively, you can test the raw tracker UI offline viacd ml-core && python tracked_pipeline.py)
- Face Enrollment: To add a new student, use the
Enroll Studentform on the Faculty Dashboard. This commits a facial embedding to the Supabase pgvector infrastructure. - Performance Tuning: You can adjust Tracker behaviour by modifying
ml-core/bytetrack.yamlor adjust Thresholds insideml-core/tracked_pipeline.py. - Absentee Logic: Students not positively identified via 3-frame consensus during an active class period are automatically flipped back to Absent upon boundary resets.
- Ensure your primary webcam is not locked by other applications (
CAMERA_ID=0). - The neural tracker relies heavily on
ultralytics>=8.4.41to support latestfuse_scoremetric integrations. - System metrics strictly enforce mathematical Cosine Similarity (
target_threshold=0.45) rather than Euclidean distance formulas.