Spaces:
Runtime error
Runtime error
Shafeek Saleem
commited on
Commit
•
0651d29
1
Parent(s):
45067dd
bug fixed - image read
Browse files
pages/3_Face Encodings.py
CHANGED
@@ -17,7 +17,7 @@ def step3_page():
|
|
17 |
st.header("Feature encoding")
|
18 |
st.markdown(
|
19 |
"""
|
20 |
-
### What is Face
|
21 |
In face recognition, face encodings are numerical representations of facial features that are used to uniquely identify individuals.
|
22 |
These encodings are obtained by extracting relevant facial information from an input image or video frame.
|
23 |
|
@@ -55,12 +55,12 @@ def step3_page():
|
|
55 |
st.subheader("Lets create face encodings for the known-faces.")
|
56 |
face_encodings_dict = {}
|
57 |
if st.button("Create Face Encodings"):
|
58 |
-
my_bar = st.progress(0, text="Generating encodings...")
|
59 |
if len(images) > 0:
|
60 |
for i, img in enumerate(images):
|
61 |
-
face_image =
|
62 |
my_face_encoding = face_recognition.face_encodings(face_image)[0]
|
63 |
-
my_bar.progress(int((i + 1) / len(images) * 100), text="Generating encodings...")
|
64 |
face_encodings_dict[img.split("_")[1]] = my_face_encoding
|
65 |
my_bar.progress(100, text="Successfully encoded all the known faces!")
|
66 |
st.success("Face encoding completed successfully!")
|
|
|
17 |
st.header("Feature encoding")
|
18 |
st.markdown(
|
19 |
"""
|
20 |
+
### What is Face Encoding?
|
21 |
In face recognition, face encodings are numerical representations of facial features that are used to uniquely identify individuals.
|
22 |
These encodings are obtained by extracting relevant facial information from an input image or video frame.
|
23 |
|
|
|
55 |
st.subheader("Lets create face encodings for the known-faces.")
|
56 |
face_encodings_dict = {}
|
57 |
if st.button("Create Face Encodings"):
|
58 |
+
my_bar = st.progress(0, text="Generating face encodings...")
|
59 |
if len(images) > 0:
|
60 |
for i, img in enumerate(images):
|
61 |
+
face_image = face_recognition.load_image_file(os.path.join(img_dir, img))
|
62 |
my_face_encoding = face_recognition.face_encodings(face_image)[0]
|
63 |
+
my_bar.progress(int((i + 1) / len(images) * 100), text="Generating face encodings...")
|
64 |
face_encodings_dict[img.split("_")[1]] = my_face_encoding
|
65 |
my_bar.progress(100, text="Successfully encoded all the known faces!")
|
66 |
st.success("Face encoding completed successfully!")
|