Skip to content

Commit

Permalink
Create biometric_authentication.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 14, 2024
1 parent 1f505d9 commit 3898a01
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# File name: biometric_authentication.py
import face_recognition
import numpy as np

class BiometricAuthentication:
def __init__(self):
self.known_faces = []

def enroll_face(self, image):
face_encoding = face_recognition.face_encodings(image)[0]
self.known_faces.append(face_encoding)

def authenticate(self, image):
unknown_face_encoding = face_recognition.face_encodings(image)[0]
results = face_recognition.compare_faces(self.known_faces, unknown_face_encoding)
return results

0 comments on commit 3898a01

Please sign in to comment.