Spaces:
Runtime error
Runtime error
Kdorlette
commited on
Commit
·
da5b3f8
1
Parent(s):
de89825
fixed image output show
Browse files
app.py
CHANGED
@@ -16,17 +16,18 @@ if input_image is not None:
|
|
16 |
face_locations = face_recognition.face_locations(image)
|
17 |
|
18 |
st.write("I found {} face(s) in this photograph.".format(len(face_locations)))
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
31 |
else:
|
32 |
st.write("Please upload an image to proceed.")
|
|
|
16 |
face_locations = face_recognition.face_locations(image)
|
17 |
|
18 |
st.write("I found {} face(s) in this photograph.".format(len(face_locations)))
|
19 |
+
|
20 |
+
cols= st.columns(len(face_locations))
|
21 |
+
for i in range(len(face_locations)):
|
22 |
+
col = cols[i]
|
23 |
+
face = face_locations[i]
|
24 |
+
with col1:
|
25 |
+
st.header("Face {}".format(i))
|
26 |
+
# Print the location of each face in this image
|
27 |
+
top, right, bottom, left = face_location
|
28 |
+
# You can access the actual face itself like this:
|
29 |
+
face_image = image[top:bottom, left:right]
|
30 |
+
pil_image = Image.fromarray(face_image)
|
31 |
+
st.image(pil_image)
|
32 |
else:
|
33 |
st.write("Please upload an image to proceed.")
|