A category mask represented as a Uint8ClampedArray or WebGLTexture-backed MPImage where each pixel represents the class which the pixel in the original image was predicted to belong to.
Multiple masks represented as Float32Array or WebGLTexture-backed MPImages where, for each mask, each pixel represents the prediction confidence, usually in the [0, 1] range.
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.
A category mask represented as a Uint8ClampedArray or WebGLTexture-backed MPImage where each pixel represents the class which the pixel in the original image was predicted to belong to.
Signature:
readonlycategoryMask?:MPMask|undefined;
ImageSegmenterResult.confidenceMasks
Multiple masks represented as Float32Array or WebGLTexture-backed MPImages where, for each mask, each pixel represents the prediction confidence, usually in the [0, 1] range.
Signature:
readonlyconfidenceMasks?:MPMask[]|undefined;
ImageSegmenterResult.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.
Signature:
readonlyqualityScores?:number[]|undefined;
ImageSegmenterResult.close()
Frees the resources held by the category and confidence masks.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-07 UTC."],[],[],null,["# ImageSegmenterResult class\n\n\u003cbr /\u003e\n\nThe output result of ImageSegmenter.\n\n**Signature:** \n\n export declare class ImageSegmenterResult \n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|------------------------------------------------------------------------------------------------------------------------------------|-----------|---------------------------------------------------------------|\n| [(constructor)(confidenceMasks, categoryMask, qualityScores)](./tasks-vision.imagesegmenterresult#imagesegmenterresultconstructor) | | Constructs a new instance of the `ImageSegmenterResult` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|--------------------------------------------------------------------------------------------|-----------|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [categoryMask](./tasks-vision.imagesegmenterresult#imagesegmenterresultcategorymask) | | [MPMask](./tasks-vision.mpmask#mpmask_class) \\| undefined | A category mask represented as a `Uint8ClampedArray` or `WebGLTexture`-backed `MPImage` where each pixel represents the class which the pixel in the original image was predicted to belong to. |\n| [confidenceMasks](./tasks-vision.imagesegmenterresult#imagesegmenterresultconfidencemasks) | | [MPMask](./tasks-vision.mpmask#mpmask_class)\\[\\] \\| undefined | Multiple masks represented as `Float32Array` or `WebGLTexture`-backed `MPImage`s where, for each mask, each pixel represents the prediction confidence, usually in the \\[0, 1\\] range. |\n| [qualityScores](./tasks-vision.imagesegmenterresult#imagesegmenterresultqualityscores) | | number\\[\\] \\| undefined | 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. |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|--------------------------------------------------------------------------|-----------|----------------------------------------------------------------|\n| [close()](./tasks-vision.imagesegmenterresult#imagesegmenterresultclose) | | Frees the resources held by the category and confidence masks. |\n\nImageSegmenterResult.(constructor)\n----------------------------------\n\nConstructs a new instance of the `ImageSegmenterResult` class\n\n**Signature:** \n\n constructor(\n confidenceMasks?: MPMask[] | undefined, \n categoryMask?: MPMask | undefined, \n qualityScores?: number[] | undefined);\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------------|---------------------------------------------------------------|-------------|\n| confidenceMasks | [MPMask](./tasks-vision.mpmask#mpmask_class)\\[\\] \\| undefined | |\n| categoryMask | [MPMask](./tasks-vision.mpmask#mpmask_class) \\| undefined | |\n| qualityScores | number\\[\\] \\| undefined | |\n\nImageSegmenterResult.categoryMask\n---------------------------------\n\nA category mask represented as a `Uint8ClampedArray` or `WebGLTexture`-backed `MPImage` where each pixel represents the class which the pixel in the original image was predicted to belong to.\n\n**Signature:** \n\n readonly categoryMask?: MPMask | undefined;\n\nImageSegmenterResult.confidenceMasks\n------------------------------------\n\nMultiple masks represented as `Float32Array` or `WebGLTexture`-backed `MPImage`s where, for each mask, each pixel represents the prediction confidence, usually in the \\[0, 1\\] range.\n\n**Signature:** \n\n readonly confidenceMasks?: MPMask[] | undefined;\n\nImageSegmenterResult.qualityScores\n----------------------------------\n\nThe 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.\n\n**Signature:** \n\n readonly qualityScores?: number[] | undefined;\n\nImageSegmenterResult.close()\n----------------------------\n\nFrees the resources held by the category and confidence masks.\n\n**Signature:** \n\n close(): void;\n\n**Returns:**\n\nvoid"]]