You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@qwn19970728 thx, but i did changed that before, and i can get the same embedding for one image twice. and the distance in this issue was calculated by these embeddings
使用get_emb.py得到两张照片中的人脸embding,但是经过测试,两张照片同一个人和两张照片不同的人距离差别不大,请问如何来设置阈值呢?我使用的是欧氏距离计算
同一个人对应的距离:
dist1 : [[0.23265116]]
dist2 : 0.23265092
dist3 : 0.07422299692117233
simlarity : 0.9729368
不同人对应的距离::
dist1 : [[0.33493966]]
dist2 : 0.33493972
dist3 : 0.1071193271412563
simlarity : 0.94390774
其中dist1是我自己写的计算欧氏距离的函数,dist2使用的是作者提供的计算欧氏距离的函数,dist3是使用作者提供的计算cos距离的函数得到的,simlarity计算的是相似度,计算方式是:
def distance(embeddings1, embeddings2):
dot = np.dot(embeddings1, embeddings2)
norm = np.linalg.norm(embeddings1, ord=2) * np.linalg.norm(embeddings2, ord=2)
similarity = dot / norm
if similarity > 1:
similarity = 1.0
return similarity
大家都有这种问题吗?
The text was updated successfully, but these errors were encountered: