Skip to content

ManHinnn0509/FaceRec_ClockIn

Repository files navigation

FaceRec_ClockIn

畢業專題 - 人臉辨識打卡機

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

Setup

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

Requirements

See requirements.txt

  • There might be some required lib(s) that aren't included / listed in requirements.txt.

Core libs:

To-do

Supervisor (Admin?) windows

Students

  • Students list window
  • Student info window
  • Press F5 to refresh data (Fetch again from database)

Sessions

  • Sessions list window
  • Session info window
  • Press F5 to refresh data (Fetch again from database)

Main menu window

  • Title (Header?)
  • Create button for Register window
  • Create button for Sign in window

Register 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

Sign in window

  • 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-spoofing

  • 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.

Notes / References

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

Firebase

"Nodes" in database:

  • students
  • sessions

Operations

  • 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()

Notes / References

Stack Overflow

Firebase Doc

Releases

No releases published

Packages

 
 
 

Contributors