Python 评估研究论文中人脸识别模型的正确程序是什么?

Python 评估研究论文中人脸识别模型的正确程序是什么?,python,face-recognition,Python,Face Recognition,最近,我不得不重现一个人脸识别模型的准确度,以查看其准确度是否与论文中的相同。为了进行测试,我有一个“.txt”文件,从中我获得了带有键“matches”和“not_matches”的字典,其值是元组列表。因此,我实现了以下代码: def get_accuracy_parameters(json_distances_path, threshold): with open(json_distances_path, 'r') as f: distances = json.load(f) ma

最近,我不得不重现一个人脸识别模型的准确度,以查看其准确度是否与论文中的相同。为了进行测试,我有一个“.txt”文件,从中我获得了带有键“matches”和“not_matches”的字典,其值是元组列表。因此,我实现了以下代码:

def get_accuracy_parameters(json_distances_path, threshold):
with open(json_distances_path, 'r') as f:
    distances = json.load(f)
match_list = distances['matches']
not_match_list = distances['not_matches']
TP, FP, TN, FN = 0,0,0,0
for distance_val in match_list:
    if distance_val <= threshold:
        TP += 1
    else:
        FN += 1
for distance_val in not_match_list:
    if distance_val <= threshold:
        FP += 1
    else:
        TN += 1
TPR = TP/(TP + FN)
FPR = FP/(FP + TN)
Acc = (TP + TN)/(TP + FN + FP + TN)
FAR = FPR # false acceptance rate
FRR = FN/(TP + FN) # false rejection rate
return TPR, FPR, Acc, FAR, FRR
def get_accurity_参数(json_距离_路径,阈值):
以开放(json_距离_路径,'r')作为f:
距离=json.load(f)
匹配列表=距离['matches']
不匹配列表=距离['不匹配']
TP,FP,TN,FN=0,0,0,0
对于匹配列表中的距离值:

如果距离值,那么匹配列表中的“else”是否为假阳性?@MYousefi我认为应该是FN,因为我们预测它们不匹配,这是错误的。我很困惑。“匹配”数据不是网络预测的匹配对吗?如果是,并且一对的距离超出了匹配容差,这不是误报吗?匹配列表中的“else”案例是否不是误报?@MYousefi我认为应该是FN,因为我们预测它们不匹配,这是错误的。我很困惑。“匹配”数据不是网络预测的匹配对吗?如果是,并且一对的距离超出了匹配公差,这不是误报吗?