Add quality scores to Segmenter tasks

PiperOrigin-RevId: 534497957
This commit is contained in:
Sebastian Schmidt
2023-05-23 11:37:26 -07:00
committed by Copybara-Service
parent 87f525c76b
commit 1fe78180c8
8 changed files with 85 additions and 11 deletions
@@ -30,7 +30,13 @@ export class InteractiveSegmenterResult {
* `WebGLTexture`-backed `MPImage` where each pixel represents the class
* which the pixel in the original image was predicted to belong to.
*/
readonly categoryMask?: MPMask) {}
readonly categoryMask?: MPMask,
/**
* 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.
*/
readonly qualityScores?: number[]) {}
/** Frees the resources held by the category and confidence masks. */
close(): void {