removed useless [0] for face_locn in refimg code
This commit is contained in:
@@ -139,10 +139,9 @@ def GenThumb(fname):
|
||||
# used to store refimg data into the DB
|
||||
def GenFace(fname, model):
|
||||
img = face_recognition.load_image_file(fname)
|
||||
# TODO: change face_locations call basedon model
|
||||
location = face_recognition.face_locations(img, model=model)
|
||||
encodings = face_recognition.face_encodings(img, known_face_locations=location)
|
||||
if len(encodings):
|
||||
return encodings[0].tobytes(), location
|
||||
return encodings[0].tobytes(), location[0]
|
||||
else:
|
||||
return None, None
|
||||
|
||||
Reference in New Issue
Block a user