人脸识别精度调整
This commit is contained in:
parent
7509ff0e15
commit
7b6f5008ce
|
@ -95,13 +95,15 @@ class FaceLogin(CreateAPIView):
|
|||
user_l.append(i['user'])
|
||||
face_l.append(i['face_data'])
|
||||
|
||||
results = face_recognition.compare_faces(face_l, unknown_face_encoding, tolerance=0.2)
|
||||
results = face_recognition.compare_faces(face_l, unknown_face_encoding, tolerance=0.5)
|
||||
for index, value in enumerate(results):
|
||||
if value:
|
||||
# 识别成功
|
||||
refresh = RefreshToken.for_user(User.objects.get(id=user_l[index]))
|
||||
user = User.objects.get(id=user_l[index])
|
||||
refresh = RefreshToken.for_user(user)
|
||||
return Response({
|
||||
'refresh': str(refresh),
|
||||
'access': str(refresh.access_token),
|
||||
'username':user.username
|
||||
})
|
||||
return Response('未找到对应用户', status=status.HTTP_400_BAD_REQUEST)
|
Loading…
Reference in New Issue