thresh = non_gallery_sims_sorted[max(int((non_gallery_sims_sorted.shape[0]) * far) - 1, 0)]
required_topk = [math.ceil(query_num * x) for x in Fars]
neg_sims = heapq.nlargest(max(required_topk), neg_sims) # heap sort
for far, pos in zip(Fars, required_topk):
th = neg_sims[pos - 1]
deepinsight/insightface#1739
https://github.com/deepinsight/insightface/blob/master/recognition/_evaluation_/ijb/ijb_evals.py use the
to get threshold
old code use
to get threshold
and they combine the g1 and g2, which is not ask to combine