Hello @layumi
I didn't quite understand your mAP calculation.
Is there any explanation you could share me?
Why are you adding olp_precision even though every ap is being summed up
And also I didn't get why we should divide by 2 before sum them up (here: ap = ap + d_recall*(old_precision + precision)/2)
def compute_mAP(index, good_index, junk_index):
ap = 0
cmc = torch.IntTensor(len(index)).zero_()
if good_index.size==0: # if empty
cmc[0] = -1
return ap,cmc
# remove junk_index
mask = np.in1d(index, junk_index, invert=True)
index = index[mask]
# find good_index index
ngood = len(good_index)
mask = np.in1d(index, good_index)
rows_good = np.argwhere(mask==True)
rows_good = rows_good.flatten()
cmc[rows_good[0]:] = 1
for i in range(ngood):
d_recall = 1.0/ngood
precision = (i+1)*1.0/(rows_good[i]+1)
if rows_good[i]!=0:
old_precision = i*1.0/rows_good[i]
else:
old_precision=1.0
ap = ap + d_recall*(old_precision + precision)/2
return ap, cmc
Hello @layumi I didn't quite understand your mAP calculation. Is there any explanation you could share me? Why are you adding
olp_precision
even though everyap
is being summed up And also I didn't get why we should divide by2
before sum them up (here:ap = ap + d_recall*(old_precision + precision)/2
)