Spaces:
Runtime error
Runtime error
Shafeek Saleem commited on
Commit ·
3acfa00
1
Parent(s): 2736c78
added face encodings page dhk
Browse filesFiles changed (2)
61 unmodified lines626364656667686961 unmodified linesface_image = face_recognition.load_image_file(os.path.join(img_dir, img))my_face_encoding = face_recognition.face_encodings(face_image)my_bar.progress(int((i + 1) / len(images) * 100), text="Generating face encodings...")with open(os.path.join(".sessions", get_login()["username"], "face_encodings",img.split("_")[1]+".npy"), 'wb') as f:np.save(f, my_face_encoding)# face_encodings_dict[img.split("_")[1]] = my_face_encoding.tolist()my_bar.progress(100, text="Successfully encoded all the known faces!")st.success("Face encoding completed successfully!")61 unmodified lines6263646566676861 unmodified linesface_image = face_recognition.load_image_file(os.path.join(img_dir, img))my_face_encoding = face_recognition.face_encodings(face_image)my_bar.progress(int((i + 1) / len(images) * 100), text="Generating face encodings...")np.save(os.path.join(".sessions", get_login()["username"], "face_encodings",img.split("_")[1]+".npy"), my_face_encoding)# face_encodings_dict[img.split("_")[1]] = my_face_encoding.tolist()my_bar.progress(100, text="Successfully encoded all the known faces!")st.success("Face encoding completed successfully!")
36 unmodified lines373839404142434445464736 unmodified linesknown_face_names = []if len(face_encodings) > 0:for i, face_encoding in enumerate(face_encodings):with open(os.path.join(face_encodings_dir, face_encoding), 'rb') as f:known_face_encoding = np.load(f)face_name = img.split(".")[0]known_face_encodings.append(known_face_encoding)known_face_names.append(face_name)while True:# Grab a single frame of video36 unmodified lines3738394041424344454636 unmodified linesknown_face_names = []if len(face_encodings) > 0:for i, face_encoding in enumerate(face_encodings):known_face_encoding = np.load(os.path.join(face_encodings_dir, face_encoding))face_name = img.split(".")[0]known_face_encodings.append(known_face_encoding)known_face_names.append(face_name)while True:# Grab a single frame of video
pages/3_Face Encodings.py+1-2
pages/4_Face Recognition.py+4-5