just in case, if location or encoding is null when GenFace is run then return None, and catch this in person and show error on GUI -- for now uploading from a phone does odd things to the image format and fails to work in face_recognition.load_image()
This commit is contained in:
@@ -141,7 +141,7 @@ def GenFace(fname, model):
|
||||
img = face_recognition.load_image_file(fname)
|
||||
location = face_recognition.face_locations(img, model=model)
|
||||
encodings = face_recognition.face_encodings(img, known_face_locations=location)
|
||||
if len(encodings):
|
||||
if len(encodings) and len(location):
|
||||
return encodings[0].tobytes(), location[0]
|
||||
else:
|
||||
return None, None
|
||||
|
||||
Reference in New Issue
Block a user