darpanaswal commited on
Commit
d292544
·
verified ·
1 Parent(s): 68fba31

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +3 -5
run.py CHANGED
@@ -5,12 +5,12 @@ from PIL import Image, ImageDraw
5
  import pandas as pd
6
 
7
 
8
- def predict_and_show(image_path):
9
  X = np.load("X.npy")
10
  Y = np.load("Y.npy")
11
 
12
  attendance = []
13
- image = face_recognition.load_image_file(image_path)
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
- x = pd.DataFrame(attendance, columns=["Name"])
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