evaluateInstanceSegmentation - Evaluate instance segmentation data set against ground truth - MATLAB (original) (raw)
Evaluate instance segmentation data set against ground truth
Since R2022b
Syntax
Description
[metrics](#mw%5F84d80ab0-a78b-4459-9ef7-b4021ead92b5) = evaluateInstanceSegmentation([dsResults](#mw%5Fcf0d9a31-9009-46ab-bd34-bffcf9b1b0af),[dsTruth](#mw%5F8581a457-6299-4b0f-b6cd-f4c19b3379c3))
calculates various metrics to evaluate the quality of the instance segmentation results,dsResults
, against the ground truth segmentation,dsTruth
.
[metrics](#mw%5F84d80ab0-a78b-4459-9ef7-b4021ead92b5) = evaluateInstanceSegmentation([dsResults](#mw%5Fcf0d9a31-9009-46ab-bd34-bffcf9b1b0af),[dsTruth](#mw%5F8581a457-6299-4b0f-b6cd-f4c19b3379c3),[threshold](#mw%5F25951cad-5e35-400f-a75b-4b37da0643d3))
also specifies an overlap threshold for the intersection over union (IoU) metric, or Jaccard Index. When the IoU of the predicted object mask in dsResults
and the ground truth object mask in dsTruth
is equal to or greater than the overlap threshold, the prediction is considered a true positive.
[metrics](#mw%5F84d80ab0-a78b-4459-9ef7-b4021ead92b5) = evaluateInstanceSegmentation(___,Verbose=[verbose](#mw%5Ffbe81d33-87ef-43e8-b7ae-1da426343881))
also specifies whether to display evaluation progress information in the command window.
Input Arguments
Predicted instance segmentation, specified as a datastore. The data must be set up so that calling the datastore with the read function returns a cell array with at least three elements. The table describes the format of the three required elements.
masks | labels | scores |
---|---|---|
Predicted binary masks, specified as a logical array of size_H_-by-_W_-by-M. Each mask is the segmentation of one instance in the image. | Predicted object labels, specified as an _M_-by-1 categorical vector. | Predicted scores, specified as an _M_-by-1 numeric vector. |
The order of the elements does not matter. When the datastore returns a cell array with more than three elements, the evaluateInstanceSegmentation
function assumes that the first element with logical data contains the instance masks, the first element with categorical data contains the label data, and the first element with numeric data contains the scores.
You can get predicted instance segmentations by using the segmentObjects function.
Ground truth instance segmentation, specified as a datastore. The data must be set up so that calling the datastore with the read function returns a cell array with at least two elements. The table describes the format of the two required elements.
masks | labels |
---|---|
Ground truth binary masks, specified as a logical array of size_H_-by-_W_-by-M. Each mask is the segmentation of one instance in the image. | Ground truth object labels, specified as an_M_-by-1 categorical vector. |
The order of the elements does not matter. When the datastore returns a cell array with more than two elements, the evaluateInstanceSegmentation
function assumes that the first element with logical data contains the instance masks, and the first element with categorical data contains the label data.
Overlap threshold for a predicted object mask to be considered a true positive, specified as a numeric scalar or numeric vector. When you specify a numeric vector, theevaluateInstanceSegmentation
function calculates metrics for each threshold.
Display evaluation progress information in the command window, specified as a numeric or logical 1
(true
) or0
(false
). The displayed information includes a progress bar, elapsed time, estimated time remaining, and data set metrics.
Data Types: logical
Output Arguments
Version History
Introduced in R2022b