AI-Powered Face Recognition for Student Attendance. Local. Fast. Private.
Smart Needle is a 100% local, privacy-first facial similarity engine that registers student identities, encodes them into deep face embeddings, and automatically detects who appears in any class or group photo β no cloud, no external APIs, no data leaving your machine.
- π Privacy First β All face detection and embedding runs locally on your device. Your photos never leave your machine.
- π§ ArcFace Embeddings β Powered by InsightFace's
buffalo_lmodel for stable 512-dimensional face vectors with strong identity separation. - β‘ Smart Rebuild β Hash-based change detection means only modified or new identity folders get reprocessed. Adding one student? Only that student gets recalculated.
- π₯ Many-to-Many Detection β Upload a class photo and get back a structured report of which students are present, with confidence scores and bounding boxes.
- ποΈ Threshold Slider β Adjust match sensitivity in real time. Lower it for noisy group photos, raise it for stricter matching.
- πΌοΈ Annotated Output β Every result image is saved with bounding boxes and name labels drawn on detected faces.
- Backend: Python (FastAPI, InsightFace, OpenCV, Uvicorn)
- Face Model: ArcFace
buffalo_lvia ONNX Runtime (CPU & GPU) - Embedding Storage: Smart Pickle (hash-tracked, incremental)
- Frontend: Single-file HTML/CSS/JS dashboard β no build step required
- Python 3.9β3.11
- pip or conda
git clone https://github.com/UnityAppSuite/Smart-Needle.git
cd Smart-Needlecd backend
python -m venv venv
# Activate (Windows)
venv\Scripts\activate
# Activate (Mac/Linux)
source venv/bin/activate
pip install -r requirements.txtFirst run downloads the
buffalo_lmodel (~500MB) automatically. Subsequent starts take ~10 seconds.
Open backend/app/core/config.py and set your base path:
_BACKEND = r"C:\path\to\Smart-Needle\backend" # Windows
SIMILARITY_THRESHOLD = 0.30uvicorn main:app --reload --port 8000In a second terminal, from the project root:
python -m http.server 5500Open http://localhost:5500/smart-needle-ui.html in Chrome or Edge.
-
Add References β Create one folder per student inside
backend/app/data/reference/. Name each folder with the student's ID or name and put their photos inside. -
Build Embeddings β Go to Dashboard β β‘ Smart Rebuild. The engine processes only new or changed folders.
-
Recognize Faces β Go to Recognize, upload any scene image (noisy, multi-face, crowded), and see every detected face matched to an identity.
-
Search by Person β Go to Search, pick a student name, and find every image in your collection where that student appears.