I have a problem while implementing f1score at object level. I have a mask and prediction of a nucleI, each mask has 500-1000 nucleui and i need to find out the F1score. The F1score will be calculated if a nuclei in mask and prediction have IOU>=.5 then true positive =1. So how can i compare all the nuclei in a mask to the prediction?

0.png1000×1000 34.6 KB