A desktop application that uses face recognition to automate attendance tracking. Built with Python, it uses deep learning models (SCRFD + ArcFace) running on ONNX Runtime to detect and identify faces in real-time through a webcam feed.
-
Register — Admin captures an employee's face through the webcam. The system extracts a 512-dimensional face embedding using ArcFace and stores it in a local SQLite database alongside user details.
-
Scan — When someone stands in front of the camera, the system detects their face using SCRFD, generates their embedding, and compares it against all registered users using cosine similarity. If a match is found above the threshold (default 40%), their attendance is logged with a timestamp.
-
Dashboard — View attendance records by date, see who checked in and when, and export reports to CSV.
- Face Detection: SCRFD (via InsightFace's
buffalo_lmodel pack) - Face Recognition: ArcFace — generates 512-D face embeddings
- Inference: ONNX Runtime (CPU, with optional GPU support)
- GUI: CustomTkinter (modern dark-themed desktop UI)
- Camera: OpenCV with threaded capture
- Database: SQLite
- Language: Python 3.10+
- Python 3.10 or higher
- A working webcam
- ~500MB disk space (for model files downloaded on first run)
# clone the repo
git clone https://github.com/Avneesh11905/attendance_system-.git
cd attendance_system-
# create virtual environment
python -m venv venv
# activate it
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate
# install dependencies
pip install -r requirements.txtpython -m app.mainOn the first run, the InsightFace buffalo_l model pack (~300MB) will be downloaded automatically. This only happens once.
- Click Register in the sidebar
- Position the person's face in the camera
- Click Capture Face — the system will detect and highlight the face
- Fill in Name, Employee ID, and Department
- Click Register User
- Click Scan in the sidebar
- Auto-scan is on by default — just stand in front of the camera
- The system will match your face and log attendance automatically
- A green checkmark means attendance was recorded; orange means already checked in today
- Click Dashboard in the sidebar
- Navigate between dates using the arrow buttons
- Click Export CSV to save records to a file
- Similarity Threshold — controls how strict face matching is (lower = more lenient)
- Camera — switch between connected cameras
├── app/
│ ├── main.py # entry point
│ ├── config.py # settings and constants
│ ├── core/
│ │ ├── face_engine.py # SCRFD + ArcFace inference wrapper
│ │ ├── camera.py # threaded camera capture
│ │ └── database.py # SQLite operations
│ ├── ui/
│ │ ├── app_window.py # main window with sidebar
│ │ ├── scan_frame.py # live scanning screen
│ │ ├── register_frame.py # user registration screen
│ │ ├── dashboard_frame.py# attendance records view
│ │ └── settings_frame.py # app settings
│ └── utils/
│ └── helpers.py # image conversion, embedding utils
├── data/ # SQLite database (auto-created)
├── face_models/ # ONNX models (auto-downloaded)
└── requirements.txt
Camera Frame
↓
SCRFD Face Detection (det_10g.onnx)
↓ bounding box + 5 facial landmarks
Face Alignment (affine transform using landmarks)
↓ normalized 112×112 face crop
ArcFace Embedding (w600k_r50.onnx)
↓ 512-dimensional feature vector
Cosine Similarity vs. registered embeddings
↓ score > threshold?
Log Attendance to SQLite
- Face embeddings are stored as binary blobs in SQLite — no images are saved
- Each user can only check in once per day (duplicate prevention)
- Camera runs in a separate thread so the UI stays responsive
- Inference runs in a background thread to avoid frame drops
- The InsightFace
buffalo_lmodels are for non-commercial/research use. See InsightFace license for details.