Skip to content

MaskUploadPlugin

Segmentation mask upload plugin

Uploads segmentation mask to an image texture that can be reused by plugins next in the rendering pipeline. Uploading texture ones and reusing it speeds up rendering. Most plugins that post-process or utilize mask depend on MaskUploadPlugin and require it to be attached to renderer. Mask texture will be loaded and added to the corresponding Pose, Face, or Mask of the tracking results as maskTex field of BodyMaskTexture type. Evaluation of body segmentation mask must be enabled in @geenee/bodyprocessors!PoseProcessor#init setting @geenee/bodyprocessors!PoseParams#mask to true or @geenee/bodyprocessors!FaceProcessor#init setting @geenee/bodyprocessors!FaceParams#mask to true.

new MaskUploadPlugin(size): MaskUploadPlugin

Constructor

Size = ...

Size of segmentation mask

MaskUploadPlugin

Plugin.constructor

loaded: boolean

Loaded state

Plugin.loaded


ordinal: number

Ordinal number

Plugin.ordinal


protected optional renderer: Renderer<SegmentationResult>

Renderer loaded the plugin

Plugin.renderer


protected size: Size

Size of segmentation mask

dispose(): void

Dispose video plugin

void

Plugin.dispose


load(renderer): Promise<void>

Initialize plugin

Initializes texture to upload segmentation mask.

Renderer<SegmentationResult>

Renderer this plugin is attached to

Promise<void>

Promise resolving when initialization is finished

Plugin.load


setupCamera(ratio, angle): void

Set camera parameters

Could be overridden to adjust plugin’s pipeline.

number

Aspect ration of input video

number

Vertical field of view in radians

void

Plugin.setupCamera


setupVideo(size): void

Set video size

Could be overridden to adjust plugin’s pipeline.

Size

Resolution of input video

void

Plugin.setupVideo


unload(): void

Reset plugin

Releases all resources and instances created in load().

void

Plugin.unload


update(result, stream): Promise<void>

Upload segmentation masks

Uploads segmentation mask to texture and adds corresponding field to results of tracking to be used by plugins next in the pipeline.

SegmentationResult

Results of video processing

HTMLCanvasElement

Captured video frame

Promise<void>

Plugin.update