Spaces:
Runtime error
Runtime error
Shafeek Saleem
commited on
Commit
•
19127c5
1
Parent(s):
5d0a9c4
fixed face detection page
Browse files- pages/4_Face Recognition.py +10 -2
pages/4_Face Recognition.py
CHANGED
@@ -27,7 +27,15 @@ def infer(image):
|
|
27 |
video_capture = cv2.VideoCapture(0)
|
28 |
|
29 |
def step4_page():
|
30 |
-
st.header("Trying It Out")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
st.info(
|
32 |
"Now that we know how our face recognition application works, let's try it out!"
|
33 |
)
|
@@ -38,7 +46,7 @@ def step4_page():
|
|
38 |
if len(face_encodings) > 0:
|
39 |
for i, face_encoding in enumerate(face_encodings):
|
40 |
known_face_encoding = np.load(os.path.join(face_encodings_dir, face_encoding))
|
41 |
-
face_name =
|
42 |
known_face_encodings.append(known_face_encoding)
|
43 |
known_face_names.append(face_name)
|
44 |
|
|
|
27 |
video_capture = cv2.VideoCapture(0)
|
28 |
|
29 |
def step4_page():
|
30 |
+
st.header("Face Recognition: Trying It Out")
|
31 |
+
st.write(
|
32 |
+
"""
|
33 |
+
Once the face encodings are obtained, they can be stored in a database or used for face recognition tasks.
|
34 |
+
During face recognition, the encodings of input faces are compared to the stored encodings (our known-face database)
|
35 |
+
to determine if a match exists. Various similarity metrics, such as Euclidean distance or cosine similarity,
|
36 |
+
can be utilized to measure the similarity between face encodings and determine potential matches.
|
37 |
+
"""
|
38 |
+
)
|
39 |
st.info(
|
40 |
"Now that we know how our face recognition application works, let's try it out!"
|
41 |
)
|
|
|
46 |
if len(face_encodings) > 0:
|
47 |
for i, face_encoding in enumerate(face_encodings):
|
48 |
known_face_encoding = np.load(os.path.join(face_encodings_dir, face_encoding))
|
49 |
+
face_name = face_encoding.split(".")[0]
|
50 |
known_face_encodings.append(known_face_encoding)
|
51 |
known_face_names.append(face_name)
|
52 |
|