@vincentt-xr/sdk 2.0.0-alpha.8 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GROUNDING.md +4643 -170
- package/README.md +1 -0
- package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
- package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
- package/dist/DebuggerUI-7ngnJsBe.js +275 -0
- package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
- package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
- package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
- package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/loaders.d.ts +16 -1
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/calibration/calibration.d.ts +11 -6
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +69 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
- package/dist/components/BodyTracker/index.d.ts +10 -2
- package/dist/components/BodyTrigger/index.d.ts +49 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +5 -3
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +9 -0
- package/dist/components/FaceMesh/index.d.ts +1 -1
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandOccluder.d.ts +55 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +101 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +69 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/LipEffect/LipEffect.d.ts +22 -2
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +62 -10
- package/dist/components/LipEffect/LipEffects.d.ts +5 -2
- package/dist/components/LipEffect/defaults.d.ts +21 -2
- package/dist/components/LipEffect/index.d.ts +1 -1
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +117 -13
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +82 -10
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +6 -0
- package/dist/components/LipEffect/uvGuide.d.ts +31 -16
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/ShoulderOccluder/index.d.ts +43 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-BH7PdKFS.cjs +1 -0
- package/dist/contexts-jak8-tND.js +667 -0
- package/dist/coordinates/index.d.ts +2 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/index.d.ts +4 -3
- package/dist/debug-ui/media-source/index.d.ts +1 -1
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +3 -2
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +3 -2
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2250 -2472
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +3 -2
- package/dist/entries/face-effects.d.ts +114 -8
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +28 -1
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/tracking.d.ts +37 -2
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2252 -83
- package/dist/face-effects.js +14234 -1231
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/gestures/definitions.d.ts +15 -2
- package/dist/gestures/index.d.ts +1 -1
- package/dist/gestures/measures.d.ts +21 -8
- package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
- package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +178 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +8 -0
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- package/dist/index-B1_TzJaI.js +1104 -0
- package/dist/index-BavF06C6.js +190 -0
- package/dist/index-BfFmpddl.cjs +21 -0
- package/dist/index-BuBzneeW.cjs +46 -0
- package/dist/index-CGsQWodV.cjs +1 -0
- package/dist/index-CIe7eCMH.js +3200 -0
- package/dist/index-CfSF8LXa.cjs +1 -0
- package/dist/index-D5GTzOzD.cjs +1 -0
- package/dist/index-DBhQzvVa.js +314 -0
- package/dist/index-DE17y0ZI.cjs +1 -0
- package/dist/index-JII7huPk.js +442 -0
- package/dist/index-tpCr9CLj.cjs +1 -0
- package/dist/{renderPasses-NnKZVfBy.js → index-w1S7fI2B.js} +219 -247
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-vsfNQycj.js → internal-B90P-clC.js} +138 -118
- package/dist/internal-Cjinca64.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +15 -10
- package/dist/iris/compute.d.ts +7 -5
- package/dist/iris/types.d.ts +6 -4
- package/dist/{landmarkMask-CbTFzBYG.js → landmarkMask-BFDyBnKM.js} +6 -6
- package/dist/landmarks-BlUqf5MZ.cjs +1 -0
- package/dist/landmarks-bftdwq6Z.js +76 -0
- package/dist/loaders-BGAUACsd.js +363 -0
- package/dist/loaders-BJ1_QCHt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +666 -602
- package/dist/main.cjs +1 -1
- package/dist/main.js +866 -1182
- package/dist/models/Body/index.d.ts +2 -0
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +3 -11
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Segmentation/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +60 -0
- package/dist/particles/system.d.ts +64 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +774 -0
- package/dist/product.cjs +1 -1
- package/dist/product.js +29 -29
- package/dist/{providers-C0Dlhh9Z.js → providers-C8rE26Uf.js} +127 -126
- package/dist/providers-DHsrhDI2.cjs +62 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-CN1cGFUo.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-O4KmaMl9.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
- package/dist/renderPasses-B6l8IpJv.js +1290 -0
- package/dist/renderPasses-dqmkft4P.cjs +158 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/segmentation-Cb3ouK6Z.js +1758 -0
- package/dist/segmentation-D9pYO6aR.cjs +1 -0
- package/dist/segmentation2d/types.d.ts +6 -0
- package/dist/select-Ck5LGz-J.cjs +1 -0
- package/dist/select-pYRo_win.js +233 -0
- package/dist/selectors-C4X71aoD.cjs +1 -0
- package/dist/selectors-DmNaKIwE.js +196 -0
- package/dist/session-BrH8G7iJ.cjs +31 -0
- package/dist/session-DgA_z6O1.js +418 -0
- package/dist/{settings-aQk845NJ.js → settings-BJ7FMBsO.js} +53 -15
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1002 -855
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- package/dist/types/nodes.d.ts +20 -1
- package/dist/types/segmentation.d.ts +5 -0
- package/dist/updateThrottle-BseecYag.js +4 -0
- package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
- package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
- package/dist/useFaceInfo-J4x7LsqL.js +76 -0
- package/dist/useFaceResultReader-BvEo5REG.js +61 -0
- package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/{useXRCapabilities-B1R2ghy-.cjs → useXRCapabilities-Cr3RzuAW.cjs} +1 -1
- package/dist/{useXRCapabilities-C68v__wB.js → useXRCapabilities-Cxmlmpbd.js} +1 -1
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +17 -0
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-CsUdQ-pn.js → uv-DJU_XfmN.js} +15 -249
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +1 -1
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +1 -1
- package/docs/api/coordinate-spaces.mdx +7 -4
- package/docs/api/cross-camera.mdx +3 -2
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +3 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +17 -11
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +4 -7
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +68 -32
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +535 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +6 -1
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +24 -19
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/multi-subject.mdx +4 -1
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +1 -1
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +5 -2
- package/docs/api/segmentation-overlay.mdx +1 -1
- package/docs/docs.json +29 -1
- package/docs/examples/lip-shaders.mdx +82 -33
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +4 -4
- package/docs/guides/lip-effect-textures.mdx +178 -102
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -1
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/package.json +11 -1
- package/dist/DebuggerUI-C-ldiozL.js +0 -269
- package/dist/DebuggerUI-CWX5EtQv.cjs +0 -1
- package/dist/FaceMeshRenderer-BEEXZwS6.cjs +0 -158
- package/dist/FaceMeshRenderer-UuH5sTXG.js +0 -1322
- package/dist/FaceRetouch-C7h7x9kd.js +0 -683
- package/dist/FaceRetouch-DqftT26Y.cjs +0 -134
- package/dist/GLTFLoader-C5q63sKO.js +0 -1633
- package/dist/GLTFLoader-Cb_CRwmG.cjs +0 -1
- package/dist/SegmentationOverlay-DQuW3dsc.js +0 -133
- package/dist/SegmentationOverlay-aWVod8Kl.cjs +0 -1
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-CO0sd4JQ.cjs +0 -1
- package/dist/contexts-FzlnnMYD.js +0 -669
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-BkZfaQs-.js +0 -118
- package/dist/getFaceInfo-ahPxQFGu.cjs +0 -1
- package/dist/index--RgGzZ6X.cjs +0 -47
- package/dist/index-CHVbH0hz.js +0 -214
- package/dist/index-CeVkgsag.cjs +0 -1
- package/dist/index-CnGox6Xr.js +0 -3054
- package/dist/index-DKBAh6hV.cjs +0 -1
- package/dist/index-DsZwTfG0.cjs +0 -1
- package/dist/index-Dw6tj2Mi.js +0 -144
- package/dist/index-OCPjOaeP.cjs +0 -1
- package/dist/index-s9pF4zkG.js +0 -2053
- package/dist/internal-BYza1h8_.cjs +0 -1
- package/dist/measures-9dQPdw96.js +0 -154
- package/dist/measures-KfJzpvod.cjs +0 -1
- package/dist/providers-YNwkmNeK.cjs +0 -62
- package/dist/renderPasses-Cg-zqmEz.cjs +0 -21
- package/dist/screenTransform-BenfCtZt.js +0 -44
- package/dist/screenTransform-BiXdpVf0.cjs +0 -1
- package/dist/segmentation-9PhSvc-R.cjs +0 -1
- package/dist/segmentation-CeOTKemr.js +0 -5
- package/dist/selectors-C5G1PMYL.js +0 -195
- package/dist/selectors-Du_PsVnW.cjs +0 -1
- package/dist/session-BBr0yN8h.cjs +0 -31
- package/dist/session-Cy0m7l7-.js +0 -363
- package/dist/settings-DRR7-snV.cjs +0 -1
- package/dist/useFaceInfo-Blf7FCu3.js +0 -303
- package/dist/useFaceInfo-C5mO8NQY.cjs +0 -1
package/dist/types/face.d.ts
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import { Category, Matrix, NormalizedLandmark } from '@mediapipe/tasks-vision';
|
|
2
|
-
import { Vector3 } from 'three';
|
|
2
|
+
import { Quaternion, Vector3 } from 'three';
|
|
3
3
|
export type FaceModelOptions = {
|
|
4
4
|
numFaces?: number;
|
|
5
5
|
};
|
|
6
6
|
export type Face = {
|
|
7
7
|
transform: {
|
|
8
8
|
position: Vector3;
|
|
9
|
+
/**
|
|
10
|
+
* Rotation READING in the SDK's sign convention (radians): X pitch, + =
|
|
11
|
+
* looking up; Y yaw, + = turning to the person's own left; Z roll, + =
|
|
12
|
+
* tilting toward the person's own left shoulder — on every feed. Not a
|
|
13
|
+
* three.js rotation — do not apply it to an object; use `quaternion` for
|
|
14
|
+
* that.
|
|
15
|
+
*/
|
|
9
16
|
rotation: Vector3;
|
|
17
|
+
/**
|
|
18
|
+
* The head's orientation in three.js world axes (+X screen right, +Y up,
|
|
19
|
+
* +Z toward the viewer), for the feed as displayed. Identity = facing the
|
|
20
|
+
* camera. `FaceTracker` applies this to its group.
|
|
21
|
+
*/
|
|
22
|
+
quaternion: Quaternion;
|
|
10
23
|
scale: Vector3;
|
|
11
24
|
};
|
|
12
25
|
gestures: Record<string, number>;
|
|
26
|
+
/**
|
|
27
|
+
* The face was read from a mirrored feed (the front webcam). MediaPipe's
|
|
28
|
+
* own sides (landmark indices, `…Left` / `…Right` blendshapes) are then the
|
|
29
|
+
* person's opposite side (GROUNDING "Left and right").
|
|
30
|
+
*/
|
|
31
|
+
mirrored: boolean;
|
|
13
32
|
};
|
|
14
33
|
export type FaceBounds = {
|
|
15
34
|
minX: number;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { TrackerPoint } from './common';
|
|
2
2
|
export type Handedness = "left" | "right";
|
|
3
3
|
export type HandData = {
|
|
4
|
+
/** 21 joints in tracker space (centre origin, ±1, Y up; `z` is relative depth). */
|
|
4
5
|
coordinates?: TrackerPoint[];
|
|
6
|
+
/**
|
|
7
|
+
* 21 joints in the hand's metric frame: centimetres, origin at the hand
|
|
8
|
+
* centre, three.js axes (+X screen right, +Y up, +Z toward the viewer).
|
|
9
|
+
*/
|
|
10
|
+
worldCoordinates?: TrackerPoint[];
|
|
5
11
|
gesture?: "closed_fist" | "open_palm";
|
|
12
|
+
/** The person's anatomical hand on every source (mirrored webcam or not). */
|
|
6
13
|
handedness?: Handedness;
|
|
14
|
+
/** MediaPipe's handedness confidence, 0..1. */
|
|
15
|
+
handednessScore?: number;
|
|
7
16
|
};
|
|
8
17
|
export type HandTrackingData = {
|
|
9
18
|
hands?: HandData[];
|
package/dist/types/nodes.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { Texture, Camera } from 'three';
|
|
|
3
3
|
import { TrackerPoint } from './common';
|
|
4
4
|
import { Face, FaceRawTrackingData } from './face';
|
|
5
5
|
import { GestureData } from './gesture-tracking';
|
|
6
|
-
import { HandData } from './hand-tracking';
|
|
6
|
+
import { HandData, Handedness } from './hand-tracking';
|
|
7
|
+
import { HandPose, HandPoses } from '../hand/handPose';
|
|
7
8
|
import { HolisticActiveDelegate, HolisticResult, HolisticRuntimeOptions, HolisticTrackingStatus } from './holistic';
|
|
8
9
|
import { SemanticMask } from '../segmentation2d/types';
|
|
9
10
|
import { SegmentationData, SemanticSegmentationStatus } from './segmentation';
|
|
@@ -43,9 +44,21 @@ export type XRModelNodeHolisticTracking = {
|
|
|
43
44
|
};
|
|
44
45
|
export type XRModelNodeBodyTracking = {
|
|
45
46
|
getLandmarks2D: (bodyIndex?: number) => TrackerPoint[] | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Per-landmark visibility (0..1, MediaPipe's estimate that the point is in
|
|
49
|
+
* frame and not occluded), in landmark order. Optional for custom nodes.
|
|
50
|
+
*/
|
|
51
|
+
getVisibility?: (bodyIndex?: number) => number[] | undefined;
|
|
46
52
|
};
|
|
47
53
|
export type XRModelNodeHandTracking = {
|
|
48
54
|
hands?: HandData[];
|
|
55
|
+
/**
|
|
56
|
+
* Both hands by anatomical side, with stable identity through label flips
|
|
57
|
+
* and short dropouts (`assignHandPoses`). `null` = that hand is not tracked.
|
|
58
|
+
*/
|
|
59
|
+
poses?: HandPoses;
|
|
60
|
+
/** `poses[hand]`. */
|
|
61
|
+
getHandPose?: (hand: Handedness) => HandPose | null;
|
|
49
62
|
coordinates?: HandData["coordinates"];
|
|
50
63
|
gesture?: HandData["gesture"];
|
|
51
64
|
handedness?: HandData["handedness"];
|
|
@@ -56,6 +69,12 @@ export type XRModelNodeGestureTracking = {
|
|
|
56
69
|
};
|
|
57
70
|
export type XRModelNodeFaceTracking = {
|
|
58
71
|
detectionResults?: FaceLandmarkerResult;
|
|
72
|
+
/**
|
|
73
|
+
* How many faces the shared face model was started with (`numFaces` of the
|
|
74
|
+
* first consumer to start it; default 1). Read-only: the model reports at
|
|
75
|
+
* most this many faces until it is started again. Optional for custom nodes.
|
|
76
|
+
*/
|
|
77
|
+
readonly numFaces?: number;
|
|
59
78
|
getDetectionResults: () => FaceLandmarkerResult | undefined;
|
|
60
79
|
getFace: (faceIndex?: number) => Face | undefined;
|
|
61
80
|
getRawFaceTrackingData: (faceIndex?: number) => FaceRawTrackingData | undefined;
|
|
@@ -18,6 +18,11 @@ export type SegmentationData = {
|
|
|
18
18
|
maskData: Uint8Array | null;
|
|
19
19
|
width: number;
|
|
20
20
|
height: number;
|
|
21
|
+
/**
|
|
22
|
+
* `performance.now()` when the frame this mask comes from was segmented
|
|
23
|
+
* (the clock hand poses use): pair it with tracking from the same moment.
|
|
24
|
+
*/
|
|
25
|
+
timestampMs?: number;
|
|
21
26
|
};
|
|
22
27
|
export type SegmentationQuality = "low" | "medium" | "high";
|
|
23
28
|
export type SegmentationModelOptions = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=(t,d,o)=>!!(o&&o>0&&t-d<1/o);exports.shouldSkipUpdate=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react"),M=require("./select-Ck5LGz-J.cjs"),_=require("@react-three/fiber"),C=require("./index-CfSF8LXa.cjs"),N=require("./getFaceInfo-B1otSDMX.cjs"),b=require("./useFaceResultReader-DuaL1KJG.cjs"),q=require("./landmarks-BlUqf5MZ.cjs"),h=({active:i=!0,holdMs:d=250,numFaces:r=1,targetFps:t,throttleMs:u=16}={})=>{const{camera:s}=_.useThree(),a=Number.isFinite(r)?Math.min(M.XR_MAX_SUBJECTS.face.max,Math.max(1,Math.round(r))):1,l=t!==void 0&&Number.isFinite(t)&&t>0?t:void 0,e=c.useMemo(()=>({numFaces:a,...l?{targetFps:l}:{}}),[a,l]),{node:n,ready:m}=q.useXRModel(C.XRModel.FACE_TRACKER,e,i);c.useEffect(()=>{if(n)for(let o=0;o<e.numFaces;o+=1)n.setCamera(s,o)},[e.numFaces,s,n]);const f=c.useCallback(o=>{if(!n)return[];const x=[];for(let F=0;F<o.faceLandmarks.length;F+=1){const R=N.getFaceInfoFromResults(n,o,F);R&&x.push(R)}return x},[n]);return b.useFaceResultReader({enabled:i&&m,holdMs:Number.isFinite(d)?Math.max(0,d):250,node:n,prepare:f,throttleMs:Number.isFinite(u)?Math.max(0,u):16})},E=4,T=({faceIndex:i=0,numFaces:d,subject:r,...t}={})=>{const u=Number.isFinite(i)?Math.max(0,Math.round(i)):0,s=h({...t,numFaces:Math.max(d??(r?E:u+1),u+1)}),a=c.useRef(M.EMPTY_SUBJECT_MEMORY),l=JSON.stringify(r??null),e=c.useMemo(()=>{if(!r)return null;const n=s.map((m,f)=>({index:f,center:{x:m.bounds.centerX,y:m.bounds.centerY},size:m.bounds.width}));return M.selectSubject(n,r,a.current)},[s,l]);return c.useEffect(()=>{e&&(a.current=e.memory)},[e]),r?e&&e.index!==null?s[e.index]??null:null:s[u]??null};exports.DEFAULT_POLICY_NUM_FACES=E;exports.useFaceInfo=T;exports.useFaceInfos=h;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useMemo as x, useEffect as p, useCallback as h, useRef as E } from "react";
|
|
2
|
+
import { X as R, E as C, s as N } from "./select-pYRo_win.js";
|
|
3
|
+
import { useThree as _ } from "@react-three/fiber";
|
|
4
|
+
import { X as b } from "./index-CIe7eCMH.js";
|
|
5
|
+
import { g as y } from "./getFaceInfo-Cu4xDWiL.js";
|
|
6
|
+
import { u as T } from "./useFaceResultReader-BvEo5REG.js";
|
|
7
|
+
import { u as X } from "./landmarks-bftdwq6Z.js";
|
|
8
|
+
const S = ({
|
|
9
|
+
active: i = !0,
|
|
10
|
+
holdMs: l = 250,
|
|
11
|
+
numFaces: r = 1,
|
|
12
|
+
targetFps: s,
|
|
13
|
+
throttleMs: o = 16
|
|
14
|
+
} = {}) => {
|
|
15
|
+
const { camera: t } = _(), u = Number.isFinite(r) ? Math.min(R.face.max, Math.max(1, Math.round(r))) : 1, m = s !== void 0 && Number.isFinite(s) && s > 0 ? s : void 0, e = x(
|
|
16
|
+
() => ({
|
|
17
|
+
numFaces: u,
|
|
18
|
+
...m ? { targetFps: m } : {}
|
|
19
|
+
}),
|
|
20
|
+
[u, m]
|
|
21
|
+
), { node: n, ready: c } = X(
|
|
22
|
+
b.FACE_TRACKER,
|
|
23
|
+
e,
|
|
24
|
+
i
|
|
25
|
+
);
|
|
26
|
+
p(() => {
|
|
27
|
+
if (n)
|
|
28
|
+
for (let a = 0; a < e.numFaces; a += 1)
|
|
29
|
+
n.setCamera(t, a);
|
|
30
|
+
}, [e.numFaces, t, n]);
|
|
31
|
+
const d = h(
|
|
32
|
+
(a) => {
|
|
33
|
+
if (!n) return [];
|
|
34
|
+
const F = [];
|
|
35
|
+
for (let f = 0; f < a.faceLandmarks.length; f += 1) {
|
|
36
|
+
const M = y(n, a, f);
|
|
37
|
+
M && F.push(M);
|
|
38
|
+
}
|
|
39
|
+
return F;
|
|
40
|
+
},
|
|
41
|
+
[n]
|
|
42
|
+
);
|
|
43
|
+
return T({
|
|
44
|
+
enabled: i && c,
|
|
45
|
+
holdMs: Number.isFinite(l) ? Math.max(0, l) : 250,
|
|
46
|
+
node: n,
|
|
47
|
+
prepare: d,
|
|
48
|
+
throttleMs: Number.isFinite(o) ? Math.max(0, o) : 16
|
|
49
|
+
});
|
|
50
|
+
}, A = 4, L = ({
|
|
51
|
+
faceIndex: i = 0,
|
|
52
|
+
numFaces: l,
|
|
53
|
+
subject: r,
|
|
54
|
+
...s
|
|
55
|
+
} = {}) => {
|
|
56
|
+
const o = Number.isFinite(i) ? Math.max(0, Math.round(i)) : 0, t = S({
|
|
57
|
+
...s,
|
|
58
|
+
numFaces: Math.max(l ?? (r ? A : o + 1), o + 1)
|
|
59
|
+
}), u = E(C), m = JSON.stringify(r ?? null), e = x(() => {
|
|
60
|
+
if (!r) return null;
|
|
61
|
+
const n = t.map((c, d) => ({
|
|
62
|
+
index: d,
|
|
63
|
+
center: { x: c.bounds.centerX, y: c.bounds.centerY },
|
|
64
|
+
size: c.bounds.width
|
|
65
|
+
}));
|
|
66
|
+
return N(n, r, u.current);
|
|
67
|
+
}, [t, m]);
|
|
68
|
+
return p(() => {
|
|
69
|
+
e && (u.current = e.memory);
|
|
70
|
+
}, [e]), r ? e && e.index !== null ? t[e.index] ?? null : null : t[o] ?? null;
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
A as D,
|
|
74
|
+
L as a,
|
|
75
|
+
S as u
|
|
76
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useState as E, useEffect as N } from "react";
|
|
2
|
+
import { c as P } from "./getFaceInfo-Cu4xDWiL.js";
|
|
3
|
+
const S = (t, i) => t.map((e) => ({
|
|
4
|
+
landmarks: e,
|
|
5
|
+
bounds: P(e)
|
|
6
|
+
})), R = {
|
|
7
|
+
publishedCount: 0,
|
|
8
|
+
// -Infinity, not 0: the first non-empty frame must publish regardless of its
|
|
9
|
+
// timestamp (a frame at now=0 would otherwise be throttled against 0).
|
|
10
|
+
lastPublishAt: -1 / 0,
|
|
11
|
+
lastNonEmptyAt: -1
|
|
12
|
+
}, g = (t, i, e, a, l) => {
|
|
13
|
+
if (i > 0) {
|
|
14
|
+
const u = { ...t, lastNonEmptyAt: e };
|
|
15
|
+
return e - t.lastPublishAt >= a ? {
|
|
16
|
+
action: "publish",
|
|
17
|
+
state: { publishedCount: i, lastPublishAt: e, lastNonEmptyAt: e }
|
|
18
|
+
} : { action: "none", state: u };
|
|
19
|
+
}
|
|
20
|
+
return t.publishedCount === 0 ? { action: "none", state: t } : t.lastNonEmptyAt >= 0 && e - t.lastNonEmptyAt < l ? { action: "none", state: t } : {
|
|
21
|
+
action: "clear",
|
|
22
|
+
// Reset the throttle anchor so the next reacquired face publishes at once.
|
|
23
|
+
state: { publishedCount: 0, lastPublishAt: -1 / 0, lastNonEmptyAt: t.lastNonEmptyAt }
|
|
24
|
+
};
|
|
25
|
+
}, x = ({
|
|
26
|
+
enabled: t,
|
|
27
|
+
holdMs: i,
|
|
28
|
+
node: e,
|
|
29
|
+
onFrame: a,
|
|
30
|
+
prepare: l,
|
|
31
|
+
throttleMs: u
|
|
32
|
+
}) => {
|
|
33
|
+
const [d, c] = E([]);
|
|
34
|
+
return N(() => {
|
|
35
|
+
if (!t || !e) {
|
|
36
|
+
c((s) => s.length === 0 ? s : []);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let r = 0, f, m = R;
|
|
40
|
+
const p = (s, n, o) => {
|
|
41
|
+
const { action: h, state: y } = g(m, s, n, u, i);
|
|
42
|
+
m = y, h === "publish" ? c(o) : h === "clear" && c((A) => A.length === 0 ? A : []);
|
|
43
|
+
}, b = () => {
|
|
44
|
+
r = requestAnimationFrame(b), a == null || a();
|
|
45
|
+
const s = performance.now(), n = e.getDetectionResults();
|
|
46
|
+
if (!n) {
|
|
47
|
+
p(0, s, []), f = n;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (n === f) return;
|
|
51
|
+
f = n;
|
|
52
|
+
const o = l(n);
|
|
53
|
+
p(o.length, s, o);
|
|
54
|
+
};
|
|
55
|
+
return r = requestAnimationFrame(b), () => cancelAnimationFrame(r);
|
|
56
|
+
}, [t, i, e, a, l, u]), d;
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
S as p,
|
|
60
|
+
x as u
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const d=require("react"),E=require("./getFaceInfo-B1otSDMX.cjs"),F=(t,a)=>t.map(e=>({landmarks:e,bounds:E.computeLandmarkBounds(e)})),N={publishedCount:0,lastPublishAt:-1/0,lastNonEmptyAt:-1},P=(t,a,e,i,u)=>{if(a>0){const l={...t,lastNonEmptyAt:e};return e-t.lastPublishAt>=i?{action:"publish",state:{publishedCount:a,lastPublishAt:e,lastNonEmptyAt:e}}:{action:"none",state:l}}return t.publishedCount===0?{action:"none",state:t}:t.lastNonEmptyAt>=0&&e-t.lastNonEmptyAt<u?{action:"none",state:t}:{action:"clear",state:{publishedCount:0,lastPublishAt:-1/0,lastNonEmptyAt:t.lastNonEmptyAt}}},g=({enabled:t,holdMs:a,node:e,onFrame:i,prepare:u,throttleMs:l})=>{const[y,o]=d.useState([]);return d.useEffect(()=>{if(!t||!e){o(s=>s.length===0?s:[]);return}let r=0,f,b=N;const h=(s,n,c)=>{const{action:A,state:R}=P(b,s,n,l,a);b=R,A==="publish"?o(c):A==="clear"&&o(m=>m.length===0?m:[])},p=()=>{r=requestAnimationFrame(p),i==null||i();const s=performance.now(),n=e.getDetectionResults();if(!n){h(0,s,[]),f=n;return}if(n===f)return;f=n;const c=u(n);h(c.length,s,c)};return r=requestAnimationFrame(p),()=>cancelAnimationFrame(r)},[t,a,e,i,u,l]),y};exports.prepareCalibrationFaceResults=F;exports.useFaceResultReader=g;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useFrame as E } from "@react-three/fiber";
|
|
2
|
+
import { useRef as a, useCallback as g, useState as _, useEffect as G } from "react";
|
|
3
|
+
const p = 400, m = 150, R = () => ({
|
|
4
|
+
status: "waiting",
|
|
5
|
+
since: null,
|
|
6
|
+
lastMatch: null,
|
|
7
|
+
progress: 0
|
|
8
|
+
}), H = (t, e, s, r = p, c = m) => {
|
|
9
|
+
if (t.status === "done") return t;
|
|
10
|
+
e ? (t.lastMatch = s, t.since === null && (t.since = s)) : (t.lastMatch === null || s - t.lastMatch > c) && (t.since = null);
|
|
11
|
+
const n = t.since === null ? 0 : s - t.since;
|
|
12
|
+
return t.progress = r > 0 ? Math.min(n / r, 1) : t.since === null ? 0 : 1, t.status = t.progress >= 1 ? "done" : t.since === null ? "waiting" : "holding", t;
|
|
13
|
+
}, y = (t, {
|
|
14
|
+
holdMs: e = p,
|
|
15
|
+
graceMs: s = m,
|
|
16
|
+
onComplete: r
|
|
17
|
+
}) => {
|
|
18
|
+
const c = a(R()), n = a(!1), [l, o] = _("waiting"), u = a(r);
|
|
19
|
+
u.current = r;
|
|
20
|
+
const f = g(() => {
|
|
21
|
+
c.current = R(), n.current = !1, o("waiting");
|
|
22
|
+
}, []);
|
|
23
|
+
return G(f, [t, f]), { status: l, holdRef: c, matchedRef: n, reset: f, step: (d) => {
|
|
24
|
+
var h;
|
|
25
|
+
n.current = d;
|
|
26
|
+
const i = c.current, S = i.status;
|
|
27
|
+
H(i, d, performance.now(), e, s), i.status !== S && (o(i.status), i.status === "done" && ((h = u.current) == null || h.call(u)));
|
|
28
|
+
} };
|
|
29
|
+
}, b = (t) => typeof t == "string" ? t : typeof t == "function" ? "match()" : JSON.stringify(t, (e, s) => typeof s == "function" ? "match()" : s), w = () => !0, k = (t, { isInView: e = w, resetKey: s, active: r = !0, ...c } = {}) => {
|
|
30
|
+
const n = y(s, c), l = a(t);
|
|
31
|
+
l.current = t;
|
|
32
|
+
const o = a(e);
|
|
33
|
+
o.current = e;
|
|
34
|
+
const u = g(() => o.current(), []);
|
|
35
|
+
return E(() => {
|
|
36
|
+
r && n.step(!!l.current());
|
|
37
|
+
}), {
|
|
38
|
+
status: n.status,
|
|
39
|
+
holdRef: n.holdRef,
|
|
40
|
+
matchedRef: n.matchedRef,
|
|
41
|
+
isInView: u,
|
|
42
|
+
reset: n.reset
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
p as G,
|
|
47
|
+
k as a,
|
|
48
|
+
m as b,
|
|
49
|
+
R as c,
|
|
50
|
+
H as d,
|
|
51
|
+
b as s,
|
|
52
|
+
y as u
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const G=require("@react-three/fiber"),n=require("react"),d=400,S=150,R=()=>({status:"waiting",since:null,lastMatch:null,progress:0}),_=(e,r,t,c=d,u=S)=>{if(e.status==="done")return e;r?(e.lastMatch=t,e.since===null&&(e.since=t)):(e.lastMatch===null||t-e.lastMatch>u)&&(e.since=null);const s=e.since===null?0:t-e.since;return e.progress=c>0?Math.min(s/c,1):e.since===null?0:1,e.status=e.progress>=1?"done":e.since===null?"waiting":"holding",e},H=(e,{holdMs:r=d,graceMs:t=S,onComplete:c})=>{const u=n.useRef(R()),s=n.useRef(!1),[f,i]=n.useState("waiting"),o=n.useRef(c);o.current=c;const a=n.useCallback(()=>{u.current=R(),s.current=!1,i("waiting")},[]);return n.useEffect(a,[e,a]),{status:f,holdRef:u,matchedRef:s,reset:a,step:h=>{var E;s.current=h;const l=u.current,g=l.status;_(l,h,performance.now(),r,t),l.status!==g&&(i(l.status),l.status==="done"&&((E=o.current)==null||E.call(o)))}}},p=e=>typeof e=="string"?e:typeof e=="function"?"match()":JSON.stringify(e,(r,t)=>typeof t=="function"?"match()":t),T=()=>!0,L=(e,{isInView:r=T,resetKey:t,active:c=!0,...u}={})=>{const s=H(t,u),f=n.useRef(e);f.current=e;const i=n.useRef(r);i.current=r;const o=n.useCallback(()=>i.current(),[]);return G.useFrame(()=>{c&&s.step(!!f.current())}),{status:s.status,holdRef:s.holdRef,matchedRef:s.matchedRef,isInView:o,reset:s.reset}};exports.GESTURE_HOLD_DEFAULT_MS=d;exports.GESTURE_HOLD_GRACE_MS=S;exports.createGestureHoldState=R;exports.specKey=p;exports.stepGestureHold=_;exports.useHoldTracker=H;exports.useInstructionHold=L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const k=require("@react-three/fiber"),y=require("react"),H=require("three"),K=require("./similarityFit-BFqHND2e.cjs");function W(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const o in r)if(o!=="default"){const e=Object.getOwnPropertyDescriptor(r,o);Object.defineProperty(t,o,e.get?e:{enumerable:!0,get:()=>r[o]})}}return t.default=r,Object.freeze(t)}const l=W(H),M=new WeakMap,z=(r,t)=>{let o=M.get(r);if(!o){const e=r.onBeforeRender,c=new Set,i=function(...n){e.apply(this,n);const[m,,d]=n;c.forEach(w=>w(m,r,d))};o={previous:e,installed:i,callbacks:c},M.set(r,o),r.onBeforeRender=i}return o.callbacks.add(t),()=>{const e=M.get(r);e&&(e.callbacks.delete(t),!(e.callbacks.size>0)&&(r.onBeforeRender===e.installed&&(r.onBeforeRender=e.previous),M.delete(r)))}},U=.5,V=20,S=(r,t,o,e=V)=>{if(!t){const n=r.tracked;return r.tracked=!1,n}const c=!r.tracked,i=l.MathUtils.clamp(o,.01,1),s=c?0:r.position.distanceTo(t.translation)/Math.max(t.scale,1e-9);return c||i>=1||s>e?(r.quaternion.copy(t.quaternion),r.position.copy(t.translation),r.scale=t.scale):(r.quaternion.slerp(t.quaternion,i),r.position.lerp(t.translation,i),r.scale+=(t.scale-r.scale)*i),r.tracked=!0,c},E=new l.Quaternion,D=new l.Euler,b=new l.Vector3,F=new l.Vector3,I=new l.Vector3,j=new l.Matrix4,B=new l.Matrix4,Q=new l.Matrix4,G=(r,{canonical:t,readLive:o,offset:e,smoothing:c=U,enabled:i=!0,onFit:s,onTrackingChange:n,solve:m})=>{const d=y.useRef(null);(!d.current||d.current.length!==t.length)&&(d.current=new Float64Array(t.length));const w=y.useRef(null),_=y.useRef({tracked:!1,quaternion:new l.Quaternion,position:new l.Vector3,scale:1});k.useFrame(()=>{var A,O,L,v,N,x;const a=r.current;if(!i){S(_.current,null,c)&&(n==null||n(!1));return}if(!a)return;const R=a.parent,P=d.current;if(!R||!o(P)){a.visible=!1,S(_.current,null,c)&&(n==null||n(!1));return}a.visible=!0;const u=w.current??{scale:1,quaternion:new l.Quaternion,translation:new l.Vector3,rms:0,worldUnitsPerCm:1,count:0};m?m(P,u):(K.solveSimilarity(t,P,u),u.worldUnitsPerCm=u.scale,u.count=t.length/3),w.current=u,s==null||s(u);const p=_.current;S(p,u,c)&&(n==null||n(!0));const q=p.scale*((e==null?void 0:e.scale)??1);D.set(((A=e==null?void 0:e.rotation)==null?void 0:A[0])??0,((O=e==null?void 0:e.rotation)==null?void 0:O[1])??0,((L=e==null?void 0:e.rotation)==null?void 0:L[2])??0),E.setFromEuler(D),b.set(((v=e==null?void 0:e.position)==null?void 0:v[0])??0,((N=e==null?void 0:e.position)==null?void 0:N[1])??0,((x=e==null?void 0:e.position)==null?void 0:x[2])??0),b.applyQuaternion(p.quaternion).multiplyScalar(q),F.copy(p.position).add(b),I.setScalar(q),E.premultiply(p.quaternion),B.compose(F,E,I),R.updateMatrixWorld(),Q.copy(R.matrixWorld).invert(),j.multiplyMatrices(Q,B),j.decompose(a.position,a.quaternion,a.scale)})};exports.LANDMARK_POSE_FIT_DEFAULT_SMOOTHING=U;exports.LANDMARK_POSE_FIT_SNAP_CM=V;exports.addSceneBeforeRender=z;exports.stepLandmarkPoseSmoothing=S;exports.useLandmarkPoseFit=G;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useFrame as F } from "@react-three/fiber";
|
|
2
|
+
import { useRef as q } from "react";
|
|
3
|
+
import * as o from "three";
|
|
4
|
+
import { s as W } from "./similarityFit-Bbz-R8AY.js";
|
|
5
|
+
const M = /* @__PURE__ */ new WeakMap(), G = (e, t) => {
|
|
6
|
+
let a = M.get(e);
|
|
7
|
+
if (!a) {
|
|
8
|
+
const r = e.onBeforeRender, l = /* @__PURE__ */ new Set(), c = function(...n) {
|
|
9
|
+
r.apply(this, n);
|
|
10
|
+
const [m, , p] = n;
|
|
11
|
+
l.forEach((w) => w(m, e, p));
|
|
12
|
+
};
|
|
13
|
+
a = { previous: r, installed: c, callbacks: l }, M.set(e, a), e.onBeforeRender = c;
|
|
14
|
+
}
|
|
15
|
+
return a.callbacks.add(t), () => {
|
|
16
|
+
const r = M.get(e);
|
|
17
|
+
r && (r.callbacks.delete(t), !(r.callbacks.size > 0) && (e.onBeforeRender === r.installed && (e.onBeforeRender = r.previous), M.delete(e)));
|
|
18
|
+
};
|
|
19
|
+
}, j = 0.5, H = 20, x = (e, t, a, r = H) => {
|
|
20
|
+
if (!t) {
|
|
21
|
+
const n = e.tracked;
|
|
22
|
+
return e.tracked = !1, n;
|
|
23
|
+
}
|
|
24
|
+
const l = !e.tracked, c = o.MathUtils.clamp(a, 0.01, 1), u = l ? 0 : e.position.distanceTo(t.translation) / Math.max(t.scale, 1e-9);
|
|
25
|
+
return l || c >= 1 || u > r ? (e.quaternion.copy(t.quaternion), e.position.copy(t.translation), e.scale = t.scale) : (e.quaternion.slerp(t.quaternion, c), e.position.lerp(t.translation, c), e.scale += (t.scale - e.scale) * c), e.tracked = !0, l;
|
|
26
|
+
}, E = new o.Quaternion(), V = new o.Euler(), P = new o.Vector3(), I = new o.Vector3(), N = new o.Vector3(), O = new o.Matrix4(), U = new o.Matrix4(), D = new o.Matrix4(), J = (e, {
|
|
27
|
+
canonical: t,
|
|
28
|
+
readLive: a,
|
|
29
|
+
offset: r,
|
|
30
|
+
smoothing: l = j,
|
|
31
|
+
enabled: c = !0,
|
|
32
|
+
onFit: u,
|
|
33
|
+
onTrackingChange: n,
|
|
34
|
+
solve: m
|
|
35
|
+
}) => {
|
|
36
|
+
const p = q(null);
|
|
37
|
+
(!p.current || p.current.length !== t.length) && (p.current = new Float64Array(t.length));
|
|
38
|
+
const w = q(null), y = q({
|
|
39
|
+
tracked: !1,
|
|
40
|
+
quaternion: new o.Quaternion(),
|
|
41
|
+
position: new o.Vector3(),
|
|
42
|
+
scale: 1
|
|
43
|
+
});
|
|
44
|
+
F(() => {
|
|
45
|
+
var _, b, A, L, B, Q;
|
|
46
|
+
const s = e.current;
|
|
47
|
+
if (!c) {
|
|
48
|
+
x(y.current, null, l) && (n == null || n(!1));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!s) return;
|
|
52
|
+
const R = s.parent, S = p.current;
|
|
53
|
+
if (!R || !a(S)) {
|
|
54
|
+
s.visible = !1, x(y.current, null, l) && (n == null || n(!1));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
s.visible = !0;
|
|
58
|
+
const i = w.current ?? {
|
|
59
|
+
scale: 1,
|
|
60
|
+
quaternion: new o.Quaternion(),
|
|
61
|
+
translation: new o.Vector3(),
|
|
62
|
+
rms: 0,
|
|
63
|
+
worldUnitsPerCm: 1,
|
|
64
|
+
count: 0
|
|
65
|
+
};
|
|
66
|
+
m ? m(S, i) : (W(t, S, i), i.worldUnitsPerCm = i.scale, i.count = t.length / 3), w.current = i, u == null || u(i);
|
|
67
|
+
const d = y.current;
|
|
68
|
+
x(d, i, l) && (n == null || n(!0));
|
|
69
|
+
const v = d.scale * ((r == null ? void 0 : r.scale) ?? 1);
|
|
70
|
+
V.set(
|
|
71
|
+
((_ = r == null ? void 0 : r.rotation) == null ? void 0 : _[0]) ?? 0,
|
|
72
|
+
((b = r == null ? void 0 : r.rotation) == null ? void 0 : b[1]) ?? 0,
|
|
73
|
+
((A = r == null ? void 0 : r.rotation) == null ? void 0 : A[2]) ?? 0
|
|
74
|
+
), E.setFromEuler(V), P.set(
|
|
75
|
+
((L = r == null ? void 0 : r.position) == null ? void 0 : L[0]) ?? 0,
|
|
76
|
+
((B = r == null ? void 0 : r.position) == null ? void 0 : B[1]) ?? 0,
|
|
77
|
+
((Q = r == null ? void 0 : r.position) == null ? void 0 : Q[2]) ?? 0
|
|
78
|
+
), P.applyQuaternion(d.quaternion).multiplyScalar(v), I.copy(d.position).add(P), N.setScalar(v), E.premultiply(d.quaternion), U.compose(I, E, N), R.updateMatrixWorld(), D.copy(R.matrixWorld).invert(), O.multiplyMatrices(D, U), O.decompose(s.position, s.quaternion, s.scale);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
j as L,
|
|
83
|
+
G as a,
|
|
84
|
+
H as b,
|
|
85
|
+
x as s,
|
|
86
|
+
J as u
|
|
87
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react"),C=require("./index-
|
|
1
|
+
"use strict";const e=require("react"),C=require("./index-CfSF8LXa.cjs"),S=(s={})=>{const{enabled:c=!0,timeoutMs:i,queryPermission:l}=s,f=(s.models??[]).join("|"),a=e.useRef(s.models);a.current=s.models;const[m,b]=e.useState(null),[R,n]=e.useState("idle"),[y,o]=e.useState(null),t=e.useRef(0),u=e.useCallback(async()=>{t.current+=1;const d=t.current;n("checking");try{const r=await C.detectXRCapabilities({models:a.current,timeoutMs:i,queryPermission:l});return d!==t.current?null:(b(r),o(null),n("ready"),r)}catch(r){return d!==t.current||(o(r instanceof Error?r:new Error(String(r))),n("error")),null}},[i,l]);return e.useEffect(()=>{if(c)return u(),()=>{t.current+=1}},[c,u,f]),{capabilities:m,status:R,error:y,refresh:u}};exports.useXRCapabilities=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef as m, useState as u, useCallback as E, useEffect as R } from "react";
|
|
2
|
-
import { d as g } from "./index-
|
|
2
|
+
import { d as g } from "./index-CIe7eCMH.js";
|
|
3
3
|
const k = (t = {}) => {
|
|
4
4
|
const { enabled: c = !0, timeoutMs: o, queryPermission: l } = t, f = (t.models ?? []).join("|"), i = m(t.models);
|
|
5
5
|
i.current = t.models;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rigid canonical landmarks for the head fit: `[index, x, y, z]` in the
|
|
3
|
+
* MediaPipe canonical face frame (centimetres), generated from
|
|
4
|
+
* `canonical_face_model.obj`. Nose bridge and tip, eye corners, cheeks,
|
|
5
|
+
* temples, forehead and the upper face oval — no mouth, no lower jaw, so an
|
|
6
|
+
* open mouth or a smile does not move the fit.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CANONICAL_RIGID_LANDMARKS: ReadonlyArray<readonly [number, number, number, number]>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SimilarityFit } from './similarityFit';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical head fit.
|
|
4
|
+
*
|
|
5
|
+
* The v3 head occluder is authored in the MediaPipe canonical face frame:
|
|
6
|
+
* centimetres, +X to the tracked person's right, +Y up, +Z toward the camera,
|
|
7
|
+
* and its first 468 vertices ARE the canonical face landmarks in landmark
|
|
8
|
+
* order (`assets-src/head-occluder/head-occluder-v3.blend`). Placing it is
|
|
9
|
+
* therefore a similarity fit, not a tuned guess: the 3D similarity (scale,
|
|
10
|
+
* rotation, translation) that maps the canonical positions of ~30 rigid
|
|
11
|
+
* landmarks (nose bridge, eye corners, cheeks, temples, forehead, upper face
|
|
12
|
+
* oval — nothing the mouth or jaw moves) onto the same landmarks as the
|
|
13
|
+
* tracker sees them, in world space. Live x/y come from unprojecting the feed
|
|
14
|
+
* point onto the z = 0 plane (where `FaceTracker` lives); live depth comes
|
|
15
|
+
* from MediaPipe's landmark z, which is in the feed's normalized-x units
|
|
16
|
+
* (smaller = closer to the camera), scaled by the feed's world width.
|
|
17
|
+
*
|
|
18
|
+
* Fitting against the landmarks directly — rather than anchoring to the
|
|
19
|
+
* tracker group — keeps the result independent of the group's own pose
|
|
20
|
+
* heuristic (scale from cheek width, origin on landmark 4); the group only
|
|
21
|
+
* supplies visibility. The fit is weak-perspective: exact on the face plane,
|
|
22
|
+
* with the depth axis used to recover rotation. Since #169 the group's
|
|
23
|
+
* rotation is MediaPipe's matrix pose, which agrees with this fit to ~2°.
|
|
24
|
+
*/
|
|
25
|
+
/** Canonical landmark 4 (just above the nose tip): the point `FaceTracker` places at its origin. */
|
|
26
|
+
export declare const CANONICAL_HEAD_ANCHOR: readonly [number, number, number];
|
|
27
|
+
/** The canonical positions of the rigid landmark set, flat `[x, y, z, …]`, centimetres. */
|
|
28
|
+
export declare const CANONICAL_RIGID_POINTS: Float64Array;
|
|
29
|
+
/** The landmark indices of the rigid set, in the same order as `CANONICAL_RIGID_POINTS`. */
|
|
30
|
+
export declare const CANONICAL_RIGID_INDICES: readonly number[];
|
|
31
|
+
export type HeadPoseFit = SimilarityFit & {
|
|
32
|
+
/** World units per canonical centimetre (the fit's scale). */
|
|
33
|
+
worldUnitsPerCm: number;
|
|
34
|
+
/** Number of landmarks used. */
|
|
35
|
+
count: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Fits the canonical rigid landmark set onto `livePoints` (flat world
|
|
39
|
+
* coordinates in the same order as `CANONICAL_RIGID_INDICES`). `out` is
|
|
40
|
+
* reused when given — call it per frame without allocating.
|
|
41
|
+
*/
|
|
42
|
+
export declare const solveCanonicalHeadPose: (livePoints: ArrayLike<number>, out?: HeadPoseFit) => HeadPoseFit;
|
|
@@ -23,3 +23,20 @@ export declare function isSdkOwnedUrl(url: string): boolean;
|
|
|
23
23
|
* `modelAssetBuffer` expects.
|
|
24
24
|
*/
|
|
25
25
|
export declare function fetchAndVerifyBytes(url: string): Promise<Uint8Array>;
|
|
26
|
+
/** A held share of verified model bytes (`acquireVerifiedBytes`). */
|
|
27
|
+
export type VerifiedBytesLease = {
|
|
28
|
+
/** The verified bytes. SHARED between holders: never mutate them. */
|
|
29
|
+
readonly bytes: Promise<Uint8Array>;
|
|
30
|
+
/** Gives the share back. Idempotent. */
|
|
31
|
+
readonly release: () => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* `fetchAndVerifyBytes`, shared while held: every holder of the same URL gets
|
|
35
|
+
* one download and one hash check (the live face tracker and the still-image
|
|
36
|
+
* detector both hold `face_tracking.task`, about 3.6 MB). The bytes stay in
|
|
37
|
+
* memory only while at least one lease is held; the last `release` drops
|
|
38
|
+
* them, and the next acquire fetches again. A failure is not kept either.
|
|
39
|
+
* Hold a lease for as long as the landmarker built from it is alive, so a
|
|
40
|
+
* second landmarker started meanwhile reuses the bytes.
|
|
41
|
+
*/
|
|
42
|
+
export declare function acquireVerifiedBytes(url: string): VerifiedBytesLease;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Face-model acquisition options shared by every component that starts the
|
|
3
|
+
* face model itself (`FaceRetouch`, the face-atlas layers and makeup
|
|
4
|
+
* regions): which face to read and how many faces to ask the model for.
|
|
5
|
+
*/
|
|
6
|
+
/** A face index from any prop value: a non-negative integer, 0 when not a finite number. */
|
|
7
|
+
export declare const resolveFaceIndex: (value: unknown) => number;
|
|
8
|
+
/**
|
|
9
|
+
* How many faces to ask the shared face model for: the given count, rounded,
|
|
10
|
+
* and never fewer than `faceIndex + 1` (face 1 needs a two-face model). The
|
|
11
|
+
* first component to start the model sets its count; later ones share it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const resolveNumFaces: (faceIndex: number, value: unknown) => number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LandmarkPoseFit } from '../components/HeadOccluder/useLandmarkPoseFit';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical torso frame for the shoulder occluder.
|
|
4
|
+
*
|
|
5
|
+
* Centimetres; origin at the midpoint of the two shoulder joints (MediaPipe
|
|
6
|
+
* pose landmarks 11 / 12); +X toward screen right in the selfie view, +Y up,
|
|
7
|
+
* +Z toward the camera. The occluder mesh (`shoulder-occluder-v1.glb`, source
|
|
8
|
+
* `assets-src/head-occluder/head-occluder-v3.blend`, object `shoulder_occluder`)
|
|
9
|
+
* is authored in this frame: a shoulder bar across the deltoids, a chest /
|
|
10
|
+
* upper-back slab, two upper-arm stubs and a neck stub that overlaps the head
|
|
11
|
+
* occluder's neck.
|
|
12
|
+
*
|
|
13
|
+
* SHOULDERS ONLY. The fit reads the two shoulder joints and nothing below
|
|
14
|
+
* them: this is a selfie-mode occluder, and in a selfie framing the hips are
|
|
15
|
+
* out of frame — the pose model still predicts them, badly, and a fit that
|
|
16
|
+
* used them inflated the torso at close range. Two points give scale (their
|
|
17
|
+
* distance against the canonical 36 cm), roll (the line between them) and yaw
|
|
18
|
+
* (their depth difference); pitch is held at zero, an upright torso.
|
|
19
|
+
*
|
|
20
|
+
* X is SCREEN-based, like the head frame: +X is screen right. MediaPipe's
|
|
21
|
+
* labels are image-based — landmark 11 ("left shoulder") is the shoulder on
|
|
22
|
+
* the image's right — so 11 sits at +X, the side canonical face landmark 280
|
|
23
|
+
* appears on. In the selfie view the feed is mirrored, so screen right is the
|
|
24
|
+
* person's RIGHT shoulder; on an unmirrored source it is their left. Author
|
|
25
|
+
* asymmetric accessories for the selfie view.
|
|
26
|
+
*/
|
|
27
|
+
/** `[poseLandmarkIndex, x, y, z]` in torso centimetres. */
|
|
28
|
+
export declare const CANONICAL_TORSO_LANDMARKS: ReadonlyArray<readonly [number, number, number, number]>;
|
|
29
|
+
export declare const CANONICAL_TORSO_POINTS: Float64Array;
|
|
30
|
+
export declare const CANONICAL_TORSO_INDICES: readonly number[];
|
|
31
|
+
/** Shoulder-joint spacing the frame is built on, centimetres. */
|
|
32
|
+
export declare const CANONICAL_SHOULDER_DISTANCE = 36;
|
|
33
|
+
/**
|
|
34
|
+
* Two-point pose: `live` is `[xL, yL, zL, xR, yR, zR]` in world units for the
|
|
35
|
+
* landmarks in `CANONICAL_TORSO_INDICES` order (11 then 12). Writes scale,
|
|
36
|
+
* rotation (roll + yaw, no pitch) and translation into `out`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const solveShoulderPose: (live: ArrayLike<number>, out: LandmarkPoseFit) => LandmarkPoseFit;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* Umeyama similarity fit: the scale `s`, rotation `R` and translation `t`
|
|
4
|
+
* that best map a point set `source` onto `target` (least squares),
|
|
5
|
+
* `target ≈ s · R · source + t`, with `R` a proper rotation (no reflection).
|
|
6
|
+
*
|
|
7
|
+
* Closed form via the 3×3 cross-covariance's SVD; the SVD comes from a
|
|
8
|
+
* cyclic-Jacobi eigen-decomposition of `HᵀH`, which is all a 3×3 needs and
|
|
9
|
+
* keeps this allocation-free after the first call. Used by the canonical head
|
|
10
|
+
* fit (≈30 points per frame).
|
|
11
|
+
*/
|
|
12
|
+
export type SimilarityFit = {
|
|
13
|
+
scale: number;
|
|
14
|
+
quaternion: THREE.Quaternion;
|
|
15
|
+
translation: THREE.Vector3;
|
|
16
|
+
/** Root-mean-square residual in target units after the fit. */
|
|
17
|
+
rms: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* `source` and `target` are flat `[x0, y0, z0, x1, y1, z1, …]` arrays of equal
|
|
21
|
+
* length (≥ 3 points, not collinear). `out` is reused when given.
|
|
22
|
+
*/
|
|
23
|
+
export declare const solveSimilarity: (source: ArrayLike<number>, target: ArrayLike<number>, out?: SimilarityFit, withScale?: boolean) => SimilarityFit;
|