MathGaron / mean_average_precision

Small and simple python/numpy utility to compute mean average precision (mAP) on detection task.
MIT License
117 stars 45 forks source link

show plot forgotten #11

Closed NPetsky closed 6 years ago

NPetsky commented 6 years ago

Hey, sorry to disturb you again but I think you have forgotten the plt.show() at the end of the plot function :) And I think it would be better to print out all accumulators in the Debug case not only the 3rd:

Final match : 1 prediction per GT

    for i, acc in enumerate(accumulators):
        qty = DetectionMAP.compute_true_positive(pred_classes, gt_classes, IoU, i)
        acc.inc_good_prediction(qty)
        qty = DetectionMAP.compute_false_positive(pred_classes, pred_conf, confidence_threshold, gt_classes, IoU, i)
        acc.inc_bad_prediction(qty)
        if DEBUG:
            print(accumulators[i])
MathGaron commented 6 years ago

No worry, improving the code is not a disturbance!

For plt.show(), I decided to remove it from the plot function, so the user calls it by himself. This way it gives a bit more flexibility, for example, whether you want to do plt.show() or plt.savefig(path). I modified the readme.md example, you just need to call it that way:

mAP.plot()
plt.imshow()

For the debug, it is now fixed. I changed it while debugging and forgot about it, thanks!