Spaces:
Sleeping
Sleeping
NTAMBARA Etienne
commited on
Commit
·
1aa889d
1
Parent(s):
b47dc32
Changes Made Keys p3
Browse files
app.py
CHANGED
@@ -31,13 +31,13 @@ def recognize_face(input_image):
|
|
31 |
# Convert PIL Image to numpy array
|
32 |
img = np.array(input_image)
|
33 |
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
|
34 |
-
|
35 |
# Detect faces and encode
|
36 |
face_locations = face_recognition.face_locations(img)
|
37 |
face_encodings = face_recognition.face_encodings(img, face_locations)
|
38 |
-
|
39 |
-
# Recognize faces and fetch data from the database
|
40 |
ref = db.reference('Students')
|
|
|
|
|
41 |
recognized_faces_info = []
|
42 |
|
43 |
for (top, right, bottom, left), face_encoding in zip(face_locations, face_encodings):
|
@@ -77,4 +77,4 @@ iface = gr.Interface(
|
|
77 |
)
|
78 |
|
79 |
if __name__ == "__main__":
|
80 |
-
iface.launch(
|
|
|
31 |
# Convert PIL Image to numpy array
|
32 |
img = np.array(input_image)
|
33 |
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
|
|
|
34 |
# Detect faces and encode
|
35 |
face_locations = face_recognition.face_locations(img)
|
36 |
face_encodings = face_recognition.face_encodings(img, face_locations)
|
37 |
+
# Initialize the database reference
|
|
|
38 |
ref = db.reference('Students')
|
39 |
+
|
40 |
+
# Recognize faces and fetch data from the database
|
41 |
recognized_faces_info = []
|
42 |
|
43 |
for (top, right, bottom, left), face_encoding in zip(face_locations, face_encodings):
|
|
|
77 |
)
|
78 |
|
79 |
if __name__ == "__main__":
|
80 |
+
iface.launch(debug=True)
|