Calculating meanAP for segmentation

Hello!
I need to calculate the meanAP for segmentation of brain tumors. I have the ground truth, a matrix with 0 and 1, and the predicted segmentation also a matrix 0 and 1. I ve calculate IOU adn Dice score, but I need to calculate mAP. I ve used mAP (mean average precision function from sk-learn but I obtain nan). Do you how to calculate this score for segmentatiion easier, I ve found something on internet but only for detection!
Thanks.

Hello @David_Jitca,

Did you find any helpful solution??

I am also working on a segmentation task and I am not sure how to calculate mAP between 2 masks (i.e., ground truth and prediction).

It would be helpful if anyone can point out to useful code or give some insights.