Skip to content

PoseFilterPlugin

Pose filter plugin

Simple plugin filtering a list of detected poses by the provided predicate. Useful when application may need to ignore certain poses to provide the best quality of virtual try-on. For example to ensure that at least upper body of user is in the field of view.

Extends

Constructors

new PoseFilterPlugin()

new PoseFilterPlugin(predicate): PoseFilterPlugin

Constructor

Parameters

predicate

Predicate of pose filter

Returns

PoseFilterPlugin

Overrides

Plugin.constructor

Properties

loaded

loaded: boolean

Loaded state

Inherited from

Plugin.loaded


ordinal

ordinal: number

Ordinal number

Inherited from

Plugin.ordinal


predicate()

protected predicate: (p) => boolean

Predicate of pose filter

Parameters

p: Pose

Returns

boolean


renderer?

protected optional renderer: Renderer<PoseResult>

Renderer loaded the plugin

Inherited from

Plugin.renderer

Methods

dispose()

dispose(): void

Dispose video plugin

Returns

void

Inherited from

Plugin.dispose


load()

load(renderer): Promise<void>

Initialize plugin

Initializes resources/instances needed by plugin. Overridden by derived classes for particular task.

Parameters

renderer: Renderer<PoseResult>

Renderer this plugin is attached to

Returns

Promise<void>

Promise resolving when initialization is finished

Inherited from

Plugin.load


setupCamera()

setupCamera(ratio, angle): void

Set camera parameters

Could be overridden to adjust plugin’s pipeline.

Parameters

ratio: number

Aspect ration of input video

angle: number

Vertical field of view in radians

Returns

void

Inherited from

Plugin.setupCamera


setupVideo()

setupVideo(size): void

Set video size

Could be overridden to adjust plugin’s pipeline.

Parameters

size: Size

Resolution of input video

Returns

void

Inherited from

Plugin.setupVideo


unload()

unload(): void

Reset plugin

Releases all resources/instances created in load(). Overridden by derived classes for particular task.

Returns

void

Inherited from

Plugin.unload


update()

update(result, stream): Promise<void>

Update

Override filters detected poses in place using predicate provided to constructor.

Parameters

result: PoseResult

Results of pose detection

stream: HTMLCanvasElement

Captured video frame

Returns

Promise<void>

Promise resolving when update is finished

Overrides

Plugin.update