MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / evaluate

Function evaluate

CV/GNN-Re-Ranking/utils.py:30–40  ·  view source on GitHub ↗
(index, ql,qc,gl,gc)

Source from the content-addressed store, hash-verified

28 print('Rank@1:%f Rank@5:%f Rank@10:%f mAP:%f'%(CMC[0],CMC[4],CMC[9],ap/len(query_label)))
29
30def evaluate(index, ql,qc,gl,gc):
31 query_index = np.argwhere(gl==ql)
32 camera_index = np.argwhere(gc==qc)
33
34 good_index = np.setdiff1d(query_index, camera_index, assume_unique=True)
35 junk_index1 = np.argwhere(gl==-1)
36 junk_index2 = np.intersect1d(query_index, camera_index)
37 junk_index = np.append(junk_index2, junk_index1) #.flatten())
38
39 CMC_tmp = compute_mAP(index, good_index, junk_index)
40 return CMC_tmp
41
42
43def compute_mAP(index, good_index, junk_index):

Callers 1

evaluate_ranking_listFunction · 0.70

Calls 2

compute_mAPFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected