faceplugin's picture
initial commit
901e379
raw
history blame
703 Bytes
import face_manage.manage as db_manage
from extract import GetImageInfo
def match_1_1(image1, image2):
count1, boxes1, scores1, landmarks1, alignimgs1, features1 = GetImageInfo(image1, 1)
count2, boxes2, scores2, landmarks2, alignimgs2, features2 = GetImageInfo(image2, 1)
result = False
sim = 0
if count1 != 0 and count2 != 0:
sim = db_manage.get_similarity(features1[0], features2[0])
if sim > db_manage.threshold:
result = True
else:
result = False
response = {
"confidence": sim,
"threshold": db_manage.threshold,
"result": "Same Person" if result else "Different Person"
}
return response