Download AttendanceSystem(linux)/README.md from mchuca/AttendanceSystem: direct link, hf CLI and curl.
- Browser
- Download file 6.1 kB
-
https://huggingface.co/mchuca/AttendanceSystem/resolve/main/AttendanceSystem(linux)/README.md
- Command line
-
hf download 'hf://mchuca/AttendanceSystem/AttendanceSystem(linux)/README.md'
-
curl -L -o README.md 'https://huggingface.co/mchuca/AttendanceSystem/resolve/main/AttendanceSystem(linux)/README.md'
FaceAttend for Linux
FaceAttend is a face-recognition attendance system for RTSP cameras. It records check-in and check-out automatically when people walk past a camera.
- Runs on Linux x86_64 (Ubuntu / Debian tested) with a normal CPU; no graphics card needed.
- Python 3.9.9 with PyQt5.
- Five face-recognition models to choose from, each as ONNX or the PyTorch model.
Install
Download this repository from https://huggingface.co/mchuca/AttendanceSystem. You need these three folders, in the same layout:
AttendanceSystem(linux)/ this project packages/linux/ Python 3.9.9 source and all Python packages (CPU builds) models/ face recognition modelsRun
./setup.shinsideAttendanceSystem(linux). It needs no internet whenpackages/linuxis present. It does four things:- uses Python 3.9.9 from
~/.local/opt/python-3.9.9or thePATH; otherwise it builds 3.9.9 from the bundled source into~/.local/opt/python-3.9.9. The app runs on exactly this version, so another Python 3.9.x is not used; - creates
.venv; - installs the Python packages from
packages/linux; - copies the models into
models/.
Building Python needs these system libraries (Debian/Ubuntu):
sudo apt install build-essential libssl-dev zlib1g-dev libffi-dev libsqlite3-dev libbz2-dev liblzma-dev libreadline-dev uuid-dev- uses Python 3.9.9 from
Start the app with
./run.sh.
If the window does not open, install the Qt libraries: sudo apt install libxcb-xinerama0 libxkbcommon-x11-0 libxcb-cursor0.
First steps
- Cameras β Add camera β enter the RTSP address and pick a role, then press Test connection.
- Hikvision:
rtsp://user:pass@192.168.1.64:554/Streaming/Channels/101 - Dahua:
rtsp://user:pass@IP:554/cam/realmonitor?channel=1&subtype=0 - A USB webcam:
0. A video file: its path.
- Hikvision:
- Employees β Add employee β Enroll (camera) (the person turns their head slowly) or Enroll (photos).
- Live monitor β Start monitoring.
- Attendance β daily records with absent people, the recognition log, the monthly summary, manual corrections, and CSV / Excel export.
| Camera role | Behaviour |
|---|---|
| Entry | the first sighting of the day is the check-in |
| Exit | every sighting updates the check-out; the last one of the day counts |
| Both | the first sighting is the check-in; a sighting at least Check-out min gap later is the check-out |
A check-in after Work starts plus the Late after grace minutes is marked Late.
Recognition models (Models page)
| Model | Accuracy | Speed on CPU | Size | License |
|---|---|---|---|---|
| FaceNet Β· VGGFace2 (default) | β β β β β | β β β ββ | 90 MB | MIT |
| FaceNet Β· CASIA-WebFace | β β β ββ | β β β ββ | 90 MB | MIT |
| ArcFace Β· ResNet-50 (InsightFace) | β β β β β | β ββββ | 166 MB | non-commercial research only |
| ArcFace Β· MobileFaceNet (InsightFace) | β β β β β | β β β β β | 13 MB | non-commercial research only |
| SFace (OpenCV Zoo) | β β β ββ | β β β β β | 37 MB | Apache-2.0 |
- Formats: each model can run with ONNX Runtime (faster on CPU) or as the PyTorch
.ptmodel.- For FaceNet the
.ptfile is the original release, and the ONNX version is converted from it. - ArcFace and SFace were released as ONNX. Their
.ptfiles are TorchScript conversions. - Both formats give the same results.
- For FaceNet the
- Switching models: enrolled faces are converted automatically, so nobody has to enroll again.
- Missing files: a model that isn't on the PC is downloaded from its official source when you select it, and its checksum is checked.
./prepare_models.shfetches every model in both formats in advance. - Commercial use: the ArcFace models are licensed for non-commercial research only. For commercial use, choose FaceNet or SFace.
- Thresholds: each model has its own match threshold, track gate and same-person similarity, under Settings β Recognition.
Tuning
| Setting | Default | Notes |
|---|---|---|
| Match threshold | per model | Raise it if strangers get recognized; lower it if staff stay "Unknown". |
| Votes needed to confirm | 3 of 7 | More votes means fewer false marks but slightly slower confirmation. |
| Recognition passes / s / camera | 5 | On a typical CPU, one camera gets about 2β5 passes per second. ArcFace MobileFaceNet is the lightest model for several cameras. |
| Detection image max side | 960 px | Lower it for speed, raise it when faces are small in the picture. |
| CPU threads | 0 (auto) | Limit it if other programs need CPU time. |
Troubleshooting
- The app doesn't start: run
./run.shin a terminal and read the message. Also checklogs/app.log. - "Could not load the Qt platform plugin xcb": install the Qt libraries listed under Install.
- A camera doesn't connect: check the address in VLC first. Settings β RTSP transport can be switched to
udp. - A webcam is not found: try
1,2... instead of0. Your user also needs to be in thevideogroup.
Files
| Path | What it is |
|---|---|
main.py |
start-up: logging, login, window |
core.py |
everything except the GUI: settings, SQLite database, RTSP capture, face detection (MTCNN), the recognition models (ONNX / PyTorch), matching, tracking, attendance rules, reports |
gui.py |
the PyQt5 window and its pages |
convert.py |
model conversion: FaceNet .pt β ONNX and ONNX β TorchScript .pt, each checked against its source |
setup.sh, run.sh, prepare_models.sh |
install and start |
tests/ |
unit tests (.venv/bin/python -m pytest tests) |
The app creates these at runtime:
config/settings.json;data/attendance.db;data/snapshots/,data/unknown/anddata/faces/for face pictures;logs/app.log.
Face pictures and face embeddings are personal (biometric) data. Restrict access to the data folder, and inform the people concerned and ask for their consent as your local law requires.