畢業專題 - 人臉辨識打卡機
Note
This is from 05/2022 and it was closed source, I made this new repo to make it open source.
- The UI might be broken if camera is not found
Create a .env file (Use any password value you want):
ADMIN_PASSWORD=admin123
And add the Firebase secrets JSON files to json/secrets, Firebase database url to config.py
See requirements.txt
- There might be some required lib(s) that aren't included / listed in
requirements.txt.
Core libs:
- Students list window
- Student info window
- Press F5 to refresh data (Fetch again from database)
- Sessions list window
- Session info window
- Press F5 to refresh data (Fetch again from database)
- Title (Header?)
- Create button for Register window
- Create button for Sign in window
- Basic window setting / layout
- Input fields (Student ID & name)
- Video stream from cam
- Take snapshot with button
- Face detection with taken snapshot (Limit: 1 face only)
- Format data & upload to database
- Video stream from cam
- Basic window setting / layout
- Session list (Display signed in students)
- Save session data to database on exit
- Press F5 to refresh students data (Fetch again from database)
- Anti face spoofing, or face liveness detection. Is to avoid false facial verification by using photo, video, mask or a different substitute from an authorized person's face.
github.com - juan-csv/face_liveness_detection-Anti-spoofing
pyimagesearch.com - Liveness Detection with OpenCV
medium.com - Face Spoofing Detection in Python
paperswithcode.com - Face Anti-Spoofing
"Nodes" in database:
- students
- sessions
- Adding a student to Firebase
from firebase_admin import db
studentID = ...
name = ...
faceEncoding = ...
student = Student(studentID, name, faceEncoding)
ref = db.reference("students")
ref.child(studentID).set(student.toJSON())- Deleting a student with specific Student ID
from firebase_admin import db
studentID = ...
ref = db.reference("students")
ref.child(studentID).delete()