mAP (mean Average Precision)
https://github.com/Cartucho/mAP
This code will evaluate the performance of your neural net for object recognition.
In practice, a higher mAP value indicates a better performance of your neural net, given your ground-truth and set of classes.
First, we calculate the Average Precision (AP), for each of the classes present in the ground-truth. Finally, we calculate the mAP (mean Average Precision) value.
1. Calculate AP
对于每个类来说, 将网络的输出按照score(confidence)进行降序, 并结合ground truth进行计算. --> 计算出precision/recall曲线. --> AP是曲线的面积.
2. Calculate mAP
计算所有AP的平均值.
3. 需要matplotlib. opencv库.
其计算过程如下:
1) 建立ground truth files. 将这个文件移至./ground-truth.
其中txt文件名和image文件名是一致的. txt文件每一行的格式为:
<class