How do i validate my mask rcnn model with mAP, precision, recall and f1 if my model detects multiple objects (sometimes fake ones)
I am working on a mask rcnn model that uses rgb aerial imagery to detect two kinds of roofs. I had to adjust many pieces of the mask rcnn model to get what i want, but everything works now. I am now implementing a validation loop at the end of each epoch, and already set that up. But I now want to also calculate the mAP, precision, recall, f1 and IOU of the model at each epoch. But how to do that? When my model is put into .eval(), it predicts these things for each object it finds: bounding boxes, labels, instance masks and confidence scores. But, sometimes it detects the wrong object or too many objects. How do I alter my code so can calculate these scores? Also, bonus question, how do I calculate the score for the predicted objects? Here is my code if you want to take a look. I’ll first send a few functions and then the main code. I’m still in the development stage, so not everything will be perfect: