ImageSegmenterResult

public abstract class ImageSegmenterResult

Represents the segmentation results generated by ImageSegmenter.

Public Constructors

Public Methods

abstract Optional<MPImage>
abstract Optional<List<MPImage>>
static ImageSegmenterResult
create(Optional<List<MPImage>> confidenceMasks, Optional<MPImage> categoryMask, List<Float> qualityScores, long timestampMs)
Creates an ImageSegmenterResult instance from a list of segmentation MPImage.
abstract List<Float>
abstract long
timestampMs()
Returns the timestamp that is associated with the task result object.

Inherited Methods

Public Constructors

public ImageSegmenterResult ()

Public Methods

public abstract Optional<MPImage> categoryMask ()

public abstract Optional<List<MPImage>> confidenceMasks ()

public static ImageSegmenterResult create (Optional<List<MPImage>> confidenceMasks, Optional<MPImage> categoryMask, List<Float> qualityScores, long timestampMs)

Creates an ImageSegmenterResult instance from a list of segmentation MPImage.

Parameters
confidenceMasks an Optional of List of MPImage in IMAGE_FORMAT_VEC32F1 format representing the confidence masks, where, for each mask, each pixel represents the prediction confidence, usually in the [0, 1] range.
categoryMask an Optional MPImage in IMAGE_FORMAT_ALPHA format representing a category mask, where each pixel represents the class which the pixel in the original image was predicted to belong to.
qualityScores The quality scores of the result masks, in the range of [0, 1]. Defaults to `1` if the model doesn't output quality scores. Each element corresponds to the score of the category in the model outputs.
timestampMs a timestamp for this result.

public abstract List<Float> qualityScores ()

public abstract long timestampMs ()

Returns the timestamp that is associated with the task result object.