I appreciate your interest in my site and I'm looking forward to having you here. I've done more work to keep the site secure and this should make the site easier to use. I'm hoping people will want to log in with their faces, and create new accounts with their faces. Using proximity detection, I can make sure the users face is close to the camera, and I have added a spinner to the login form.
Log in to Uglek or create an account with your face! It even works in the dark. Here's my face to go with the new feature. Visit Uglek.com/face/login to log in with your face or create a new account with your face. Try it out now!
How to identify and recognize faces using python with no APIs I use the below code to implement a login with face function on Uglek. The code works by assigning a user a face ID when they upload a face to their profile or go to log in, and then retrieving their account by image using the face ID. Here is the code
# face/face.py from django.contrib.auth.models import User import uuid from .models import Face import face_recognition NUM_FACES = 9 def get_face_id(image_path): image = face_recognition.load_image_file(image_path) face_locations = face_recognition.face_locations(image) if len(face_locations) > 1 or len(face_locations) < 1: return False for user in User.objects.filter(profile__enable_facial_recognition=True): known_image = face_recognition.load_image_file(user.profile.face.path) unknown_image = image user_encoding = face_recognition.face_encodings(known_image) user_encodings = list() user_encodings.append(user_encoding) user_faces = Face.objects.filter(user=user).order_by('-timestamp') for face in user_faces: if open(face.image.path,"rb").read() == open(image_path,"rb").read(): return False if user_faces.count() > NUM_FACES: user_faces = user_faces[:NUM_FACES] for face in user_faces: image = face_recognition.load_image_file(face.image.path) image_encoding = face_recognition.face_encodings(image) user_encodings.append(image_encoding) unknown_encoding = face_recognition.face_encodings(unknown_image) results = face_recognition.compare_faces(user_encodings, unknown_encoding) if results: return user.profile.uuid return str(uuid.uuid4())