Skip to main content

ImageSegmenterOptions

Properties

PropertyTypeDescription
canvas?OffscreenCanvasThe canvas element to bind textures to. This has to be set for GPU processing. The task will initialize a WebGL or WebGPU context and throw an error if this fails (e.g. if you have already initialized a different type of context).
delegate?DelegateOverrides the default backend to use for the provided model.
modelAsset?SegmentationModelAsset-
segmenterCanvas?OffscreenCanvasThe Google TaskVision segmentation model only works with WebGl so we need a separate canvas for this.