Skip to content

SkirtFitPlugin

Cloth plugin for armatures with auxiliary skirt bones

SkirtFitPlugin is an extension of PoseFitPlugin that controls auxiliary skirt bones of armature if presented. Skirt bones are driven by legs but has additional kinematic constrains to mimic deformation of a fabric more naturally. This technic provides for higher fidelity virtual try-on of apparels that have a loose bottom skirt by controlling this part independently and not making it stick to legs so tightly. Auxiliary skirt bones must be clones of up leg and leg bones and skirt part should be skinned against them instead of legs.

new SkirtFitPlugin(tune): SkirtFitPlugin

Constructor

PoseTuneParams = ...

Fine-tuning parameters

SkirtFitPlugin

PoseFitPlugin.constructor

readonly alignScore: 0.9 = 0.90

Pose score threshold

PoseFitPlugin.alignScore


readonly alignVisibility: 0.9 = 0.90

Keypoint visibility threshold

PoseFitPlugin.alignVisibility


protected cameraAngle: number

Camera vertical angle in radians

PoseFitPlugin.cameraAngle


protected cameraRatio: number

Camera aspect ratio

PoseFitPlugin.cameraRatio


loaded: boolean

Loaded state

PoseFitPlugin.loaded


protected optional node: TransformNode

Attached scene node

PoseFitPlugin.node


protected nodeOrigin: BoneTransform

Origin of node relative to the root bone

PoseFitPlugin.nodeOrigin


ordinal: number

Ordinal number

PoseFitPlugin.ordinal


protected optional renderer: Renderer<PoseResult>

Renderer loaded the plugin

PoseFitPlugin.renderer


protected optional scene: Scene

Reference to a scene instance

PoseFitPlugin.scene


protected optional skeleton: Skeleton

Reference to model’s skeleton

PoseFitPlugin.skeleton


protected optional skeletonNodes: SkeletonNodes

Bones of the model’s rig

PoseFitPlugin.skeletonNodes


protected optional skeletonSizes: SkeletonSizes

Reference sizes of skeleton

PoseFitPlugin.skeletonSizes


protected optional skirtSkeletonNodes: SkirtSkeletonNodes

Auxiliary bones of skirt rig


protected optional spineCurve: SpineCurve

Shape of spine

PoseFitPlugin.spineCurve


protected tune: PoseTuneParams

Fine-tuning parameters

PoseFitPlugin.tune

dispose(): void

Dispose video plugin

void

PoseFitPlugin.dispose


protected estimateBones(pose, spineCurve, skeletonSizes): object

Estimate bone positions and orientations

Using detected keypoints approximates bone transformations. Position of bone if defined by 3D point itself, bone length is the distance between keypoints connected by bone. Bone’s rotation is defined by its axes that are evaluated using kinematic rules and relative positions of adjacent keypoints. Method returns bone position and orientation in global world frame, final relative transformations are found traversing skeleton hierarchy and accumulating transforms of parents.

PosePoints

Pose keypoints

SpineCurve

Reference shape of spine

SkeletonSizes

Reference sizes of skeleton

object

Bone transformations

armL: BoneTransform = armL.arm

armMidL: BoneTransform = armL.armMid

armMidR: BoneTransform = armR.armMid

armR: BoneTransform = armR.arm

footL: BoneTransform = legL.foot

footR: BoneTransform = legR.foot

forearmL: BoneTransform = armL.forearm

forearmMidL: BoneTransform = armL.forearmMid

forearmMidR: BoneTransform = armR.forearmMid

forearmR: BoneTransform = armR.forearm

handL: BoneTransform = armL.hand

handR: BoneTransform = armR.hand

head: BoneTransform

legL: BoneTransform = legL.leg

legR: BoneTransform = legR.leg

neck: BoneTransform

neck1: BoneTransform

pelvis: BoneTransform

root: BoneTransform

shoulderL: BoneTransform = armL.shoulder

shoulderR: BoneTransform = armR.shoulder

spine: BoneTransform

spine1: BoneTransform

spine2: BoneTransform

spine3: BoneTransform

uplegL: BoneTransform = legL.upleg

uplegMidL: BoneTransform = legL.uplegMid

uplegMidR: BoneTransform = legR.uplegMid

uplegR: BoneTransform = legR.upleg

PoseFitPlugin.estimateBones


load(renderer): Promise<void>

Initialize plugin

Parses and caches the rig/armature of the attached scene node (one provided to plugin’s constructor). Precalculates geometrical parameters of skeleton.

Renderer<PoseResult>

Renderer this plugin is attached to

Promise<void>

Promise resolving when initialization is finished

PoseFitPlugin.load


setNode(node?): void

Set/attach a scene node

Extended to parses and caches auxiliary skirt bones. Backward compatible with base skeleton rig, if skirt bones are not parsed controls only the base skeleton.

TransformNode

Scene node to attach

void

PoseFitPlugin.setNode


setupCamera(ratio, angle): void

Set camera parameters

number

Aspect ration of input video

number

Vertical field of view in radians

void

PoseFitPlugin.setupCamera


setupVideo(size): void

Set video size

Could be overridden to adjust plugin’s pipeline.

Size

Resolution of input video

void

PoseFitPlugin.setupVideo


unload(): void

Reset plugin

Clears internal state and frees all resources allocated in load().

void

PoseFitPlugin.unload


update(result, stream): Promise<void>

Update skeleton of the scene node

Extends alignment of the base armature with guided control of skirt bones. Skirt bones are driven by leg bones but has additional kinematic constrains to mimic deformation of a fabric more naturally.

PoseResult

Pose estimation results

HTMLCanvasElement

Captured video frame

Promise<void>

Promise resolving when update is finished

PoseFitPlugin.update


protected updateArm(bones, points): void

Update arm rig (see update)

Arm bones and transforms

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

Arm keypoints

PosePoint

PosePoint

void

PoseFitPlugin.updateArm


protected updateLeg(bones, points): void

Update leg rig (see update)

Leg bones and transforms

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

{ bone: TransformNode; transform: BoneTransform; }

TransformNode

BoneTransform

Leg keypoints

PosePoint

PosePoint

void

PoseFitPlugin.updateLeg


protected updateSpine(transforms, bones): void

Update spine rig (see update)

Estimated transformations

BoneTransform = armL.arm

BoneTransform = armL.armMid

BoneTransform = armR.armMid

BoneTransform = armR.arm

BoneTransform = legL.foot

BoneTransform = legR.foot

BoneTransform = armL.forearm

BoneTransform = armL.forearmMid

BoneTransform = armR.forearmMid

BoneTransform = armR.forearm

BoneTransform = armL.hand

BoneTransform = armR.hand

BoneTransform = ...

BoneTransform = legL.leg

BoneTransform = legR.leg

BoneTransform = ...

BoneTransform = ...

BoneTransform = ...

BoneTransform = ...

BoneTransform = armL.shoulder

BoneTransform = armR.shoulder

BoneTransform = ...

BoneTransform = ...

BoneTransform = ...

BoneTransform = ...

BoneTransform = legL.upleg

BoneTransform = legL.uplegMid

BoneTransform = legR.uplegMid

BoneTransform = legR.upleg

SkeletonNodes

Spine bones

void

PoseFitPlugin.updateSpine