人脸识别调整
This commit is contained in:
parent
bc84a62366
commit
bf8a965586
|
@ -386,8 +386,8 @@ class FaceLogin(CreateAPIView):
|
|||
my_face_encoding = face_recognition.face_encodings(picture_of_me)[0]
|
||||
unknown_picture = face_recognition.load_image_file(filepath)
|
||||
unknown_face_encoding = face_recognition.face_encodings(unknown_picture)[0]
|
||||
results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding)
|
||||
# os.remove(filepath)
|
||||
results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding, tolerance=0.2)
|
||||
os.remove(filepath)
|
||||
if results[0] == True:
|
||||
return Response('这是曹前明')
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue