# How to compute a precision-recall curve for an instance segmentation algorithm?

Having currently read some papers about proposed solutions to the problem of instance segmentation in images, (i.e. an algorithm that takes as input raw images, and outputs instance-wise segmentation maps for a predefined set of classes), I still don't understand how to evaluate and compare their performances.

If I understand correctly, the preferred metric to evaluate the performance of such algorithms is the "mean Average Precision" (mAP), which is the average value of "Average Precision" (AP) over all classes for the particular problem. "Average Precision", in turn, is defined as the integral of the precision-recall curve.

I believe I understand how to compute the precision and the recall of such an algorithm (by directly applying the definition of these quantities, and defining a prediction as a true positive if its IoU (intersection over union) with any ground truth is higher than a threshold). However, that gives me only one pair of precision-recall values. How does one compute the entire precision-recall curve?

Apparently some parameter has to be varied to change the precision and recall of the algorithm, but I still fail to understand which, and how.

Please note that question How to form a Precision-Recall curve when I only have one value for P-R? is not asking the same thing as I am. I understand how to compute a precision-recall curve in that context. The source of my confusion is exactly the change in context. Now that an algorithm outputs several segmentation masks per-class per-image, how to extend the metric for it?

Trying to apply here the same answer given in the linked question could mean changing the threshold used to binarize the masks. However, several instance segmentation algorithms rely on a subsystem for detecting bounding boxes. Should something be changed in it too?

If you know of any, please provide references to your explanations. It seems to me there's not much consensus nor a general guideline all researchers are following.