Spaces:
Build error
Build error
Update run.py
Browse files
run.py
CHANGED
@@ -5,12 +5,12 @@ from PIL import Image, ImageDraw
|
|
5 |
import pandas as pd
|
6 |
|
7 |
|
8 |
-
def predict_and_show(
|
9 |
X = np.load("X.npy")
|
10 |
Y = np.load("Y.npy")
|
11 |
|
12 |
attendance = []
|
13 |
-
image = face_recognition.load_image_file(
|
14 |
face_bounding_boxes = face_recognition.face_locations(image)
|
15 |
if len(face_bounding_boxes) == 0:
|
16 |
print("No face found in the image")
|
@@ -31,9 +31,7 @@ def predict_and_show(image_path):
|
|
31 |
draw.text((0, 0), Y[np.argmin(distances)], (255, 255, 255))
|
32 |
#pil_image.show()
|
33 |
|
34 |
-
|
35 |
-
x.to_csv("attendance.csv", index=False)
|
36 |
-
return True
|
37 |
|
38 |
# predict_and_show()
|
39 |
|
|
|
5 |
import pandas as pd
|
6 |
|
7 |
|
8 |
+
def predict_and_show(image):
|
9 |
X = np.load("X.npy")
|
10 |
Y = np.load("Y.npy")
|
11 |
|
12 |
attendance = []
|
13 |
+
image = face_recognition.load_image_file(image)
|
14 |
face_bounding_boxes = face_recognition.face_locations(image)
|
15 |
if len(face_bounding_boxes) == 0:
|
16 |
print("No face found in the image")
|
|
|
31 |
draw.text((0, 0), Y[np.argmin(distances)], (255, 255, 255))
|
32 |
#pil_image.show()
|
33 |
|
34 |
+
return attendance
|
|
|
|
|
35 |
|
36 |
# predict_and_show()
|
37 |
|