Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -48,11 +48,31 @@ encodeListknown = [face_recognition.face_encodings(img)[0] for img in Images]
|
|
48 |
|
49 |
####### Section 3 ###################
|
50 |
# Take picture using the camera
|
51 |
-
img_file_buffer = st.camera_input("Take Your picture")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# recognise the face in the uploaded image
|
54 |
-
if
|
55 |
-
test_image = Image.open(
|
56 |
image = np.asarray(test_image)
|
57 |
image = image.copy()
|
58 |
|
|
|
48 |
|
49 |
####### Section 3 ###################
|
50 |
# Take picture using the camera
|
51 |
+
#img_file_buffer = st.camera_input("Take Your picture")
|
52 |
+
|
53 |
+
# File uploader to upload an image
|
54 |
+
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
55 |
+
|
56 |
+
#if uploaded_file is not None:
|
57 |
+
# Open the image file and convert it into a format that OpenCV can process
|
58 |
+
#image = Image.open(uploaded_file)
|
59 |
+
|
60 |
+
# Detect faces in the image
|
61 |
+
# result_image = detect_faces(image)
|
62 |
+
|
63 |
+
# Convert the result image from OpenCV format back to PIL format for display
|
64 |
+
#result_image_pil = Image.fromarray(result_image)
|
65 |
+
|
66 |
+
# Display the image with detected faces
|
67 |
+
#st.image(result_image_pil, caption="Detected Faces", use_column_width=True)
|
68 |
+
|
69 |
+
|
70 |
+
#else:
|
71 |
+
#print("no img")
|
72 |
|
73 |
# recognise the face in the uploaded image
|
74 |
+
if uploaded_file is not None:
|
75 |
+
test_image = Image.open(uploaded_file)
|
76 |
image = np.asarray(test_image)
|
77 |
image = image.copy()
|
78 |
|