(index, ql,qc,gl,gc)
| 28 | print('Rank@1:%f Rank@5:%f Rank@10:%f mAP:%f'%(CMC[0],CMC[4],CMC[9],ap/len(query_label))) |
| 29 | |
| 30 | def 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 | |
| 43 | def compute_mAP(index, good_index, junk_index): |
no test coverage detected