MathGaron/mean_average_precision

show plot forgotten

Closed this issue · 1 comments

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])

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!