@vincentt-xr/sdk 2.0.0-alpha.7 → 2.0.0-alpha.8
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 +1109 -13
- package/dist/{DebuggerUI-BjOMr8q_.js → DebuggerUI-C-ldiozL.js} +1 -1
- package/dist/{DebuggerUI-B6bP6P9r.cjs → DebuggerUI-CWX5EtQv.cjs} +1 -1
- package/dist/FaceMeshRenderer-BEEXZwS6.cjs +158 -0
- package/dist/FaceMeshRenderer-UuH5sTXG.js +1322 -0
- package/dist/FaceRetouch-C7h7x9kd.js +683 -0
- package/dist/FaceRetouch-DqftT26Y.cjs +134 -0
- package/dist/GLTFLoader-C5q63sKO.js +1633 -0
- package/dist/GLTFLoader-Cb_CRwmG.cjs +1 -0
- package/dist/SegmentationOverlay-DQuW3dsc.js +133 -0
- package/dist/SegmentationOverlay-aWVod8Kl.cjs +1 -0
- package/dist/assets/cache.d.ts +99 -0
- package/dist/assets/estimate.d.ts +11 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/loaders.d.ts +28 -0
- package/dist/assets/react.d.ts +33 -0
- package/dist/calibration/calibration.d.ts +70 -0
- package/dist/calibration/index.d.ts +6 -0
- package/dist/calibration/storage.d.ts +13 -0
- package/dist/calibration/types.d.ts +53 -0
- package/dist/calibration/useXRCalibration.d.ts +46 -0
- package/dist/camera/CameraPermissionGate.d.ts +26 -0
- package/dist/camera/devices.d.ts +26 -0
- package/dist/camera/index.d.ts +8 -0
- package/dist/camera/permission.d.ts +86 -0
- package/dist/camera/useCameraPermission.d.ts +35 -0
- package/dist/capabilities/detect.d.ts +45 -0
- package/dist/capabilities/index.d.ts +5 -0
- package/dist/capabilities/types.d.ts +120 -0
- package/dist/capabilities/useXRCapabilities.d.ts +18 -0
- package/dist/compat/environment.d.ts +5 -0
- package/dist/compat/index.d.ts +4 -0
- package/dist/compat/run.d.ts +18 -0
- package/dist/compat/scenarios.d.ts +10 -0
- package/dist/compat/types.d.ts +101 -0
- package/dist/components/BodyTracker/index.d.ts +9 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +33 -3
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +12 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +1 -1
- package/dist/components/GestureListener/index.d.ts +11 -0
- package/dist/components/HandTracker/index.d.ts +10 -0
- package/dist/components/HolisticTracker/index.d.ts +69 -0
- package/dist/components/HolisticTracker/settings.d.ts +58 -0
- package/dist/components/HolisticTracker/signals.d.ts +49 -0
- package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
- package/dist/components/IrisEffect/index.d.ts +51 -0
- package/dist/components/IrisEffect/settings.d.ts +117 -0
- package/dist/components/LipEffect/LipEffect.d.ts +7 -1
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +43 -7
- package/dist/components/LipEffect/LipEffects.d.ts +9 -0
- package/dist/components/LipEffect/defaults.d.ts +27 -4
- package/dist/components/LipEffect/index.d.ts +11 -3
- package/dist/components/LipEffect/settings.d.ts +271 -0
- package/dist/components/LipEffect/types.d.ts +56 -9
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +11 -0
- package/dist/components/LipEffect/uvGuide.d.ts +59 -0
- package/dist/components/PersonCutout/index.d.ts +50 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/source.d.ts +6 -0
- package/dist/components/ScreenImage/types.d.ts +18 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
- package/dist/components/SegmentationOverlay/index.d.ts +9 -0
- package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
- package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
- package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/constants/index.d.ts +4 -1
- package/dist/contexts-CO0sd4JQ.cjs +1 -0
- package/dist/{contexts-ByhzppYl.js → contexts-FzlnnMYD.js} +252 -246
- package/dist/coordinates/feed.d.ts +52 -0
- package/dist/coordinates/index.d.ts +5 -0
- package/dist/coordinates/spaces.d.ts +49 -0
- package/dist/coordinates/viewport.d.ts +22 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +14 -0
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui/product-hotspots/index.d.ts +24 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +25 -0
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2057 -1687
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/entries/core.d.ts +18 -1
- package/dist/entries/face-effects.d.ts +11 -3
- package/dist/entries/low-level.d.ts +22 -3
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +24 -1
- package/dist/face-effects.cjs +155 -1
- package/dist/face-effects.js +1134 -2197
- package/dist/gestures/definitions.d.ts +85 -0
- package/dist/gestures/detector.d.ts +87 -0
- package/dist/gestures/index.d.ts +8 -0
- package/dist/gestures/measures.d.ts +101 -0
- package/dist/gestures/settings.d.ts +49 -0
- package/dist/{getFaceInfo-C4QpCQIY.js → getFaceInfo-BkZfaQs-.js} +5 -5
- package/dist/{getFaceInfo-fA1bFBub.cjs → getFaceInfo-ahPxQFGu.cjs} +1 -1
- package/dist/hooks/selectors.d.ts +68 -1
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceInfo.d.ts +13 -1
- package/dist/hooks/useFaceInfos.d.ts +1 -1
- package/dist/hooks/useGesture.d.ts +32 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +7 -0
- package/dist/hooks/useXRSession/facade.d.ts +42 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +3 -1
- package/dist/hooks/useXRSession/registry.d.ts +14 -0
- package/dist/hooks/useXRSession/store.d.ts +52 -3
- package/dist/index--RgGzZ6X.cjs +47 -0
- package/dist/{index-VJ0SJwmG.js → index-CHVbH0hz.js} +4 -4
- package/dist/index-CeVkgsag.cjs +1 -0
- package/dist/index-CnGox6Xr.js +3054 -0
- package/dist/{index-ByoNj0QP.js → index-CsUdQ-pn.js} +113 -111
- package/dist/{index-BjmTe9eM.cjs → index-DKBAh6hV.cjs} +1 -1
- package/dist/index-DsZwTfG0.cjs +1 -0
- package/dist/index-Dw6tj2Mi.js +144 -0
- package/dist/index-OCPjOaeP.cjs +1 -0
- package/dist/{index-DXT3WccE.js → index-s9pF4zkG.js} +1065 -1101
- package/dist/internal-BYza1h8_.cjs +1 -0
- package/dist/{internal-Dmk1cTXq.js → internal-vsfNQycj.js} +15 -16
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/iris/compute.d.ts +25 -0
- package/dist/iris/index.d.ts +4 -0
- package/dist/iris/lead.d.ts +19 -0
- package/dist/iris/types.d.ts +87 -0
- package/dist/landmarkMask-CbTFzBYG.js +224 -0
- package/dist/landmarkMask-u7es2k4X.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1085 -634
- package/dist/main.cjs +1 -1
- package/dist/main.js +1519 -465
- package/dist/measures-9dQPdw96.js +154 -0
- package/dist/measures-KfJzpvod.cjs +1 -0
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +1 -1
- package/dist/models/Face/index.d.ts +1 -1
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +1 -1
- package/dist/models/Holistic/index.d.ts +49 -0
- package/dist/models/Holistic/result.d.ts +68 -0
- package/dist/models/SemanticSegmentation/index.d.ts +31 -0
- package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/product/ProductDimensions.d.ts +16 -0
- package/dist/product/ProductHotspot.d.ts +16 -0
- package/dist/product/ProductViewer.d.ts +9 -0
- package/dist/product/details.d.ts +53 -0
- package/dist/product/index.d.ts +14 -0
- package/dist/product/loadModelViewer.d.ts +4 -0
- package/dist/product/types.d.ts +71 -0
- package/dist/product/useProductAr.d.ts +37 -0
- package/dist/product/useProductDetails.d.ts +60 -0
- package/dist/product.cjs +1 -0
- package/dist/product.js +414 -0
- package/dist/providers-C0Dlhh9Z.js +365 -0
- package/dist/providers-YNwkmNeK.cjs +62 -0
- package/dist/quality/XRQualityController.d.ts +25 -0
- package/dist/quality/controller.d.ts +33 -0
- package/dist/quality/index.d.ts +6 -0
- package/dist/quality/types.d.ts +100 -0
- package/dist/quality/useXRQuality.d.ts +28 -0
- package/dist/{renderGroups-KZk6eRiY.js → renderGroups-CN1cGFUo.js} +1 -1
- package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-O4KmaMl9.cjs} +1 -1
- package/dist/renderPasses-Cg-zqmEz.cjs +21 -0
- package/dist/renderPasses-NnKZVfBy.js +1460 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/screenTransform-BenfCtZt.js +44 -0
- package/dist/screenTransform-BiXdpVf0.cjs +1 -0
- package/dist/segmentation-9PhSvc-R.cjs +1 -0
- package/dist/segmentation-CeOTKemr.js +5 -0
- package/dist/segmentation2d/faceMemory.d.ts +28 -0
- package/dist/segmentation2d/faceRegions.d.ts +24 -0
- package/dist/segmentation2d/index.d.ts +9 -0
- package/dist/segmentation2d/maskUv.d.ts +23 -0
- package/dist/segmentation2d/rasterize.d.ts +14 -0
- package/dist/segmentation2d/types.d.ts +46 -0
- package/dist/selectors-C5G1PMYL.js +195 -0
- package/dist/selectors-Du_PsVnW.cjs +1 -0
- package/dist/{session-CpkiK5YA.cjs → session-BBr0yN8h.cjs} +7 -7
- package/dist/{session-DLFN_VII.js → session-Cy0m7l7-.js} +76 -76
- package/dist/settings-DRR7-snV.cjs +1 -0
- package/dist/settings-aQk845NJ.js +73 -0
- package/dist/subjects/index.d.ts +2 -0
- package/dist/subjects/select.d.ts +62 -0
- package/dist/subjects/types.d.ts +55 -0
- package/dist/tracking-config/apply.d.ts +57 -0
- package/dist/tracking-config/index.d.ts +7 -0
- package/dist/tracking-config/resolve.d.ts +25 -0
- package/dist/tracking-config/storage.d.ts +8 -0
- package/dist/tracking-config/types.d.ts +106 -0
- package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
- package/dist/tracking.cjs +1 -1
- package/dist/tracking.js +1056 -383
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +27 -2
- package/dist/types/segmentation.d.ts +19 -0
- package/dist/types/session.d.ts +41 -3
- package/dist/useFaceInfo-Blf7FCu3.js +303 -0
- package/dist/useFaceInfo-C5mO8NQY.cjs +1 -0
- package/dist/useXRCapabilities-B1R2ghy-.cjs +1 -0
- package/dist/useXRCapabilities-C68v__wB.js +30 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/integrity.d.ts +4 -1
- package/dist/utils/updateThrottle.d.ts +2 -0
- package/dist/utils/useStableUniforms.d.ts +18 -0
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/coordinate-spaces.mdx +165 -0
- package/docs/api/cross-camera.mdx +88 -0
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/face-effects.mdx +6 -0
- package/docs/api/face-mesh.mdx +4 -2
- package/docs/api/gestures.mdx +173 -0
- package/docs/api/holistic-tracker.mdx +159 -0
- package/docs/api/iris-tracking.mdx +242 -0
- package/docs/api/multi-subject.mdx +95 -0
- package/docs/api/person-cutout.mdx +136 -0
- package/docs/api/product-ar.mdx +111 -0
- package/docs/api/product-details.mdx +78 -0
- package/docs/api/screen-space-coordinates.mdx +4 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/trackers.mdx +5 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +23 -1
- package/docs/examples/lip-shaders.mdx +224 -0
- package/docs/guides/lip-effect-textures.mdx +292 -0
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -0
- package/package.json +13 -1
- package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
- package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
- package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
- package/dist/FaceRetouch-DwbKQJAN.js +0 -551
- package/dist/contexts-Dr62It_K.cjs +0 -1
- package/dist/index-9dlAQAhy.js +0 -1462
- package/dist/index-BpEf2BBb.cjs +0 -1
- package/dist/index-CyUUurQT.cjs +0 -1
- package/dist/index-DCiMbxC3.cjs +0 -1
- package/dist/index-DpI-qo5X.cjs +0 -17
- package/dist/index-DyVF4vEW.js +0 -111
- package/dist/internal-Cq-TEQ5Y.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-BOoBSr8z.cjs +0 -21
- package/dist/renderPasses-BcquyVtu.js +0 -1500
- package/dist/selectors-B8H97CKA.js +0 -59
- package/dist/selectors-CZLKT2Iv.cjs +0 -1
- package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
- package/dist/useFaceInfo-Dk426LTu.js +0 -62
- package/dist/useFaceResults-CtetsO9M.js +0 -19
- package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { useState as y, useRef as
|
|
5
|
-
import { c as
|
|
6
|
-
const
|
|
1
|
+
import { l as z, u as L, g as v, X as W } from "./index-CnGox6Xr.js";
|
|
2
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal as $ } from "react-dom";
|
|
4
|
+
import { useState as y, useRef as M, useMemo as F, useEffect as f } from "react";
|
|
5
|
+
import { c as l, X } from "./x-Co8jPhP0.js";
|
|
6
|
+
const R = (t, e) => new URL(`/assets/sdk/debug-ui/v1/${t}/${e}`, z.assetStorageEndpoint).href, C = (t) => t.replace(/\.[^.]+$/, "").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), N = [
|
|
7
7
|
"person_fullbody.mp4",
|
|
8
8
|
"person_looking.mp4",
|
|
9
9
|
"person_shaking_head.mp4",
|
|
10
10
|
"person_thumbUp.mp4",
|
|
11
11
|
"two_people_smiling.mp4"
|
|
12
|
-
],
|
|
12
|
+
], P = [
|
|
13
13
|
"person_fist_sign.jpg",
|
|
14
14
|
"person_fullbody.jpg",
|
|
15
15
|
"person_peace_sign.jpg",
|
|
@@ -17,20 +17,20 @@ const M = (t, e) => new URL(`/assets/sdk/debug-ui/v1/${t}/${e}`, j.assetStorageE
|
|
|
17
17
|
"person_side_portrait.jpg",
|
|
18
18
|
"three_people_smiling.jpg",
|
|
19
19
|
"two_people_smiling.jpg"
|
|
20
|
-
],
|
|
20
|
+
], U = (t, e) => ({
|
|
21
21
|
id: `sdk-video-${e + 1}`,
|
|
22
22
|
kind: "video",
|
|
23
23
|
label: C(t),
|
|
24
|
-
url:
|
|
25
|
-
}),
|
|
24
|
+
url: R("videos", t)
|
|
25
|
+
}), V = (t, e) => ({
|
|
26
26
|
id: `sdk-image-${e + 1}`,
|
|
27
27
|
kind: "image",
|
|
28
28
|
label: C(t),
|
|
29
|
-
url:
|
|
30
|
-
}),
|
|
29
|
+
url: R("images", t)
|
|
30
|
+
}), D = N.map(U), K = P.map(V), ke = [
|
|
31
|
+
...D,
|
|
31
32
|
{ id: "webcam", kind: "webcam", label: "Webcam" },
|
|
32
|
-
...
|
|
33
|
-
...T
|
|
33
|
+
...K
|
|
34
34
|
];
|
|
35
35
|
/**
|
|
36
36
|
* @license lucide-react v1.17.0 - ISC
|
|
@@ -38,7 +38,7 @@ const M = (t, e) => new URL(`/assets/sdk/debug-ui/v1/${t}/${e}`, j.assetStorageE
|
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
39
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
const
|
|
41
|
+
const T = [
|
|
42
42
|
[
|
|
43
43
|
"path",
|
|
44
44
|
{
|
|
@@ -47,14 +47,14 @@ const A = [
|
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
49
|
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
50
|
-
],
|
|
50
|
+
], A = l("camera", T);
|
|
51
51
|
/**
|
|
52
52
|
* @license lucide-react v1.17.0 - ISC
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
56
|
*/
|
|
57
|
-
const
|
|
57
|
+
const O = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], B = l("chevron-down", O);
|
|
58
58
|
/**
|
|
59
59
|
* @license lucide-react v1.17.0 - ISC
|
|
60
60
|
*
|
|
@@ -68,7 +68,7 @@ const H = [
|
|
|
68
68
|
["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
|
|
69
69
|
["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
|
|
70
70
|
["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
|
|
71
|
-
], G =
|
|
71
|
+
], G = l("grip-vertical", H);
|
|
72
72
|
/**
|
|
73
73
|
* @license lucide-react v1.17.0 - ISC
|
|
74
74
|
*
|
|
@@ -79,7 +79,7 @@ const Y = [
|
|
|
79
79
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
80
80
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
81
81
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
82
|
-
], q =
|
|
82
|
+
], q = l("image", Y);
|
|
83
83
|
/**
|
|
84
84
|
* @license lucide-react v1.17.0 - ISC
|
|
85
85
|
*
|
|
@@ -90,7 +90,7 @@ const J = [
|
|
|
90
90
|
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
91
91
|
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
92
92
|
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
93
|
-
], Q =
|
|
93
|
+
], Q = l("menu", J);
|
|
94
94
|
/**
|
|
95
95
|
* @license lucide-react v1.17.0 - ISC
|
|
96
96
|
*
|
|
@@ -106,7 +106,7 @@ const Z = [
|
|
|
106
106
|
}
|
|
107
107
|
],
|
|
108
108
|
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2", key: "158x01" }]
|
|
109
|
-
], ee =
|
|
109
|
+
], ee = l("video", Z), te = (t) => t === "webcam" ? "📷 " : t === "image" ? "🖼 " : "▶ ", re = {
|
|
110
110
|
position: "fixed",
|
|
111
111
|
zIndex: 2e4,
|
|
112
112
|
pointerEvents: "none"
|
|
@@ -170,7 +170,7 @@ const Z = [
|
|
|
170
170
|
position: "relative",
|
|
171
171
|
display: "flex",
|
|
172
172
|
alignItems: "center"
|
|
173
|
-
},
|
|
173
|
+
}, le = {
|
|
174
174
|
width: "100%",
|
|
175
175
|
minWidth: 140,
|
|
176
176
|
height: 24,
|
|
@@ -184,7 +184,7 @@ const Z = [
|
|
|
184
184
|
paddingRight: 20,
|
|
185
185
|
appearance: "none",
|
|
186
186
|
cursor: "pointer"
|
|
187
|
-
},
|
|
187
|
+
}, de = {
|
|
188
188
|
pointerEvents: "none",
|
|
189
189
|
position: "absolute",
|
|
190
190
|
right: 5,
|
|
@@ -207,72 +207,72 @@ const Z = [
|
|
|
207
207
|
value: t,
|
|
208
208
|
onChange: e,
|
|
209
209
|
sources: i,
|
|
210
|
-
style:
|
|
210
|
+
style: c
|
|
211
211
|
}) => {
|
|
212
|
-
const [
|
|
212
|
+
const [g, d] = y(!1), [s, b] = y({ x: 16, y: 16 }), [o, u] = y(t.kind), p = M(null), w = F(
|
|
213
213
|
() => ({
|
|
214
214
|
webcam: i.filter((r) => r.kind === "webcam"),
|
|
215
215
|
image: i.filter((r) => r.kind === "image"),
|
|
216
216
|
video: i.filter((r) => r.kind === "video")
|
|
217
217
|
}),
|
|
218
218
|
[i]
|
|
219
|
-
), k = w[
|
|
219
|
+
), k = w[o];
|
|
220
220
|
f(() => {
|
|
221
|
-
|
|
221
|
+
u(t.kind);
|
|
222
222
|
}, [t.kind]);
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
|
|
223
|
+
const I = (r) => {
|
|
224
|
+
u(r);
|
|
225
|
+
const a = w[r][0];
|
|
226
|
+
a && e(a);
|
|
227
227
|
};
|
|
228
228
|
f(() => {
|
|
229
|
-
const r = (
|
|
230
|
-
p.current &&
|
|
231
|
-
x: Math.max(8,
|
|
232
|
-
y: Math.max(8,
|
|
229
|
+
const r = (m) => {
|
|
230
|
+
p.current && b({
|
|
231
|
+
x: Math.max(8, m.clientX - p.current.x),
|
|
232
|
+
y: Math.max(8, m.clientY - p.current.y)
|
|
233
233
|
});
|
|
234
|
-
},
|
|
234
|
+
}, a = () => {
|
|
235
235
|
p.current = null, document.body.classList.remove("select-none");
|
|
236
236
|
};
|
|
237
|
-
return window.addEventListener("pointermove", r), window.addEventListener("pointerup",
|
|
238
|
-
window.removeEventListener("pointermove", r), window.removeEventListener("pointerup",
|
|
237
|
+
return window.addEventListener("pointermove", r), window.addEventListener("pointerup", a), () => {
|
|
238
|
+
window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", a);
|
|
239
239
|
};
|
|
240
240
|
}, []);
|
|
241
241
|
const x = (r) => {
|
|
242
|
-
const
|
|
242
|
+
const a = r.currentTarget.getBoundingClientRect();
|
|
243
243
|
p.current = {
|
|
244
|
-
x: r.clientX -
|
|
245
|
-
y: r.clientY -
|
|
244
|
+
x: r.clientX - a.left,
|
|
245
|
+
y: r.clientY - a.top
|
|
246
246
|
}, document.body.classList.add("select-none"), r.currentTarget.setPointerCapture(r.pointerId);
|
|
247
|
-
},
|
|
247
|
+
}, j = () => k.length === 0 ? /* @__PURE__ */ n("div", { style: pe, children: o === "webcam" ? "No camera source" : o === "image" ? "No image preview" : "No video preview" }) : /* @__PURE__ */ h("div", { style: ce, children: [
|
|
248
248
|
/* @__PURE__ */ n(
|
|
249
249
|
"select",
|
|
250
250
|
{
|
|
251
251
|
value: t.id,
|
|
252
252
|
onChange: (r) => {
|
|
253
|
-
const
|
|
254
|
-
|
|
253
|
+
const a = i.find((m) => m.id === r.target.value);
|
|
254
|
+
a && e(a);
|
|
255
255
|
},
|
|
256
|
-
style:
|
|
257
|
-
children: k.map((r) => /* @__PURE__ */
|
|
258
|
-
te(
|
|
256
|
+
style: le,
|
|
257
|
+
children: k.map((r) => /* @__PURE__ */ h("option", { value: r.id, children: [
|
|
258
|
+
te(o),
|
|
259
259
|
r.label
|
|
260
260
|
] }, r.id))
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
|
-
/* @__PURE__ */ n("div", { style:
|
|
263
|
+
/* @__PURE__ */ n("div", { style: de, children: /* @__PURE__ */ n("span", { style: { width: 10, height: 10 }, children: /* @__PURE__ */ n(B, { size: 10, strokeWidth: 1.8 }) }) })
|
|
264
264
|
] });
|
|
265
|
-
return typeof document > "u" ? null :
|
|
266
|
-
/* @__PURE__ */ n("div", { style: { ...re, left:
|
|
265
|
+
return typeof document > "u" ? null : $(
|
|
266
|
+
/* @__PURE__ */ n("div", { style: { ...re, left: s.x, top: s.y, ...c }, children: g ? (
|
|
267
267
|
// --- Expanded State ---
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ h("div", { style: ie, children: [
|
|
269
|
+
/* @__PURE__ */ h("div", { style: oe, children: [
|
|
270
270
|
/* @__PURE__ */ n("div", { onPointerDown: x, style: se, title: "Drag to move", children: /* @__PURE__ */ n(G, { size: 11, strokeWidth: 2 }) }),
|
|
271
271
|
/* @__PURE__ */ n(
|
|
272
272
|
"button",
|
|
273
273
|
{
|
|
274
274
|
type: "button",
|
|
275
|
-
onClick: () =>
|
|
275
|
+
onClick: () => d(!1),
|
|
276
276
|
style: S(!1),
|
|
277
277
|
title: "Close Menu",
|
|
278
278
|
children: /* @__PURE__ */ n("span", { style: _, children: /* @__PURE__ */ n(X, { size: 14, strokeWidth: 1.8 }) })
|
|
@@ -283,15 +283,15 @@ const Z = [
|
|
|
283
283
|
"button",
|
|
284
284
|
{
|
|
285
285
|
type: "button",
|
|
286
|
-
onClick: () =>
|
|
287
|
-
style: S(
|
|
286
|
+
onClick: () => I(r),
|
|
287
|
+
style: S(o === r),
|
|
288
288
|
title: r.charAt(0).toUpperCase() + r.slice(1),
|
|
289
|
-
children: /* @__PURE__ */ n("span", { style: _, children: r === "webcam" ? /* @__PURE__ */ n(
|
|
289
|
+
children: /* @__PURE__ */ n("span", { style: _, children: r === "webcam" ? /* @__PURE__ */ n(A, { size: 14, strokeWidth: 1.8 }) : r === "image" ? /* @__PURE__ */ n(q, { size: 14, strokeWidth: 1.8 }) : /* @__PURE__ */ n(ee, { size: 14, strokeWidth: 1.8 }) })
|
|
290
290
|
},
|
|
291
291
|
r
|
|
292
292
|
))
|
|
293
293
|
] }),
|
|
294
|
-
|
|
294
|
+
j()
|
|
295
295
|
] })
|
|
296
296
|
) : (
|
|
297
297
|
// --- Collapsed State (Minimal FAB) ---
|
|
@@ -299,7 +299,7 @@ const Z = [
|
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
style: ne,
|
|
302
|
-
onClick: () =>
|
|
302
|
+
onClick: () => d(!0),
|
|
303
303
|
onPointerDown: x,
|
|
304
304
|
title: "Open Media Menu",
|
|
305
305
|
children: /* @__PURE__ */ n("span", { style: { width: 16, height: 16 }, children: /* @__PURE__ */ n(Q, { size: 14, strokeWidth: 1.8 }) })
|
|
@@ -313,51 +313,51 @@ const Z = [
|
|
|
313
313
|
e.crossOrigin = "anonymous", e.src = t, await e.decode();
|
|
314
314
|
const i = document.createElement("canvas");
|
|
315
315
|
i.width = e.naturalWidth, i.height = e.naturalHeight;
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
return
|
|
316
|
+
const c = i.getContext("2d");
|
|
317
|
+
if (!c) throw new Error("Unable to create image media canvas");
|
|
318
|
+
return c.drawImage(e, 0, 0, i.width, i.height), i.captureStream(30);
|
|
319
319
|
}, ue = async (t) => {
|
|
320
320
|
const e = document.createElement("video");
|
|
321
321
|
return e.src = t, e.loop = !0, e.muted = !0, e.playsInline = !0, e.crossOrigin = "anonymous", await e.play(), e.captureStream();
|
|
322
322
|
}, me = (t, e) => {
|
|
323
|
-
const { session: i } =
|
|
324
|
-
f(() => {
|
|
325
|
-
let
|
|
323
|
+
const { session: i } = L(), c = JSON.stringify((e == null ? void 0 : e.pipeline) ?? null), g = M(e == null ? void 0 : e.pipeline);
|
|
324
|
+
g.current = e == null ? void 0 : e.pipeline, f(() => {
|
|
325
|
+
let d = !1, s = null;
|
|
326
326
|
return (async () => {
|
|
327
327
|
try {
|
|
328
328
|
if (t.kind === "webcam")
|
|
329
329
|
await i.setMediaSource({ source: v.WEBCAM });
|
|
330
330
|
else {
|
|
331
331
|
if (!t.url) throw new Error(`Missing media URL for ${t.id}`);
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
334
|
-
|
|
332
|
+
const o = t.kind === "image" ? await ge(t.url) : await ue(t.url);
|
|
333
|
+
if (s = o, d) {
|
|
334
|
+
o.getTracks().forEach((u) => u.stop());
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
337
|
await i.setMediaSource({
|
|
338
338
|
source: v.STREAM,
|
|
339
|
-
stream:
|
|
339
|
+
stream: o,
|
|
340
340
|
sourceKind: t.kind
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
343
|
await i.registerXRPipeline(
|
|
344
|
-
|
|
345
|
-
{ model:
|
|
344
|
+
g.current ?? [
|
|
345
|
+
{ model: W.FACE_TRACKER, options: { numFaces: (e == null ? void 0 : e.numFaces) ?? 1 } }
|
|
346
346
|
]
|
|
347
347
|
), await i.start();
|
|
348
|
-
} catch (
|
|
349
|
-
console.error("[MediaSourceSession] Error initializing XR session:",
|
|
348
|
+
} catch (o) {
|
|
349
|
+
console.error("[MediaSourceSession] Error initializing XR session:", o);
|
|
350
350
|
}
|
|
351
351
|
})(), () => {
|
|
352
|
-
|
|
352
|
+
d = !0, s == null || s.getTracks().forEach((o) => o.stop());
|
|
353
353
|
};
|
|
354
|
-
}, [t, e == null ? void 0 : e.numFaces,
|
|
354
|
+
}, [t, e == null ? void 0 : e.numFaces, c, i]);
|
|
355
355
|
}, ve = me;
|
|
356
356
|
export {
|
|
357
357
|
xe as M,
|
|
358
|
-
|
|
358
|
+
D as a,
|
|
359
359
|
me as b,
|
|
360
360
|
ke as d,
|
|
361
|
-
|
|
361
|
+
K as s,
|
|
362
362
|
ve as u
|
|
363
363
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./detector-ijypGtse.cjs"),s=["both","left","right","none"],n={hands:"both",targetFps:24,analysisMaxDimension:768,holdMs:250,predictMs:0,outputFaceBlendshapes:!0},l=[{key:"hands",label:"Hands",type:"select",options:s.map(e=>({label:e,value:e}))},{key:"targetFps",label:"Target FPS (0 = uncapped)",type:"number",min:0,max:60,step:1},{key:"analysisMaxDimension",label:"Analysis max px",type:"number",min:256,max:1280,step:64},{key:"holdMs",label:"Hold (ms)",type:"number",min:0,max:1e3,step:10},{key:"predictMs",label:"Predict (ms)",type:"number",min:0,max:300,step:10},{key:"outputFaceBlendshapes",label:"Face blendshapes (re-inits)",type:"boolean"}],r=e=>({...n,...e}),i=(e,t)=>({...e,...t}),p=e=>({hands:e.hands,targetFps:e.targetFps>0?e.targetFps:void 0,analysisMaxDimension:e.analysisMaxDimension,holdMs:e.holdMs,predictMs:e.predictMs,outputFaceBlendshapes:e.outputFaceBlendshapes}),a={...o.DEFAULT_GESTURE_DETECTOR_OPTIONS},T=[{key:"enterThreshold",label:"Enter threshold",type:"number",min:0,max:1,step:.01},{key:"exitThreshold",label:"Exit threshold",type:"number",min:0,max:1,step:.01},{key:"holdMs",label:"Hold before begin (ms)",type:"number",min:0,max:1e3,step:10},{key:"cooldownMs",label:"Cooldown after end (ms)",type:"number",min:0,max:3e3,step:50},{key:"minConfidence",label:"Min confidence",type:"number",min:0,max:1,step:.05},{key:"lostGraceMs",label:"Loss grace (ms)",type:"number",min:0,max:1e3,step:10}],c=(e,t=a)=>({...t,...e}),S=(e,t)=>({...e,...t});exports.DEFAULT_GESTURE_SETTINGS=a;exports.DEFAULT_HOLISTIC_TRACKER_SETTINGS=n;exports.GESTURE_SETTINGS_FIELDS=T;exports.HOLISTIC_HANDS_OPTIONS=s;exports.HOLISTIC_TRACKER_SETTINGS_FIELDS=l;exports.patchGestureSettings=S;exports.patchHolisticTrackerSettings=i;exports.resolveGestureSettings=c;exports.resolveHolisticTrackerSettings=r;exports.toHolisticTrackerProps=p;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { D as a } from "./detector-K8aej4MB.js";
|
|
2
|
+
const t = [
|
|
3
|
+
"both",
|
|
4
|
+
"left",
|
|
5
|
+
"right",
|
|
6
|
+
"none"
|
|
7
|
+
], n = {
|
|
8
|
+
hands: "both",
|
|
9
|
+
targetFps: 24,
|
|
10
|
+
analysisMaxDimension: 768,
|
|
11
|
+
holdMs: 250,
|
|
12
|
+
predictMs: 0,
|
|
13
|
+
outputFaceBlendshapes: !0
|
|
14
|
+
}, p = [
|
|
15
|
+
{
|
|
16
|
+
key: "hands",
|
|
17
|
+
label: "Hands",
|
|
18
|
+
type: "select",
|
|
19
|
+
options: t.map((e) => ({ label: e, value: e }))
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
key: "targetFps",
|
|
23
|
+
label: "Target FPS (0 = uncapped)",
|
|
24
|
+
type: "number",
|
|
25
|
+
min: 0,
|
|
26
|
+
max: 60,
|
|
27
|
+
step: 1
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "analysisMaxDimension",
|
|
31
|
+
label: "Analysis max px",
|
|
32
|
+
type: "number",
|
|
33
|
+
min: 256,
|
|
34
|
+
max: 1280,
|
|
35
|
+
step: 64
|
|
36
|
+
},
|
|
37
|
+
{ key: "holdMs", label: "Hold (ms)", type: "number", min: 0, max: 1e3, step: 10 },
|
|
38
|
+
{ key: "predictMs", label: "Predict (ms)", type: "number", min: 0, max: 300, step: 10 },
|
|
39
|
+
{ key: "outputFaceBlendshapes", label: "Face blendshapes (re-inits)", type: "boolean" }
|
|
40
|
+
], r = (e) => ({ ...n, ...e }), i = (e, s) => ({ ...e, ...s }), m = (e) => ({
|
|
41
|
+
hands: e.hands,
|
|
42
|
+
targetFps: e.targetFps > 0 ? e.targetFps : void 0,
|
|
43
|
+
analysisMaxDimension: e.analysisMaxDimension,
|
|
44
|
+
holdMs: e.holdMs,
|
|
45
|
+
predictMs: e.predictMs,
|
|
46
|
+
outputFaceBlendshapes: e.outputFaceBlendshapes
|
|
47
|
+
}), o = { ...a }, c = [
|
|
48
|
+
{ key: "enterThreshold", label: "Enter threshold", type: "number", min: 0, max: 1, step: 0.01 },
|
|
49
|
+
{ key: "exitThreshold", label: "Exit threshold", type: "number", min: 0, max: 1, step: 0.01 },
|
|
50
|
+
{ key: "holdMs", label: "Hold before begin (ms)", type: "number", min: 0, max: 1e3, step: 10 },
|
|
51
|
+
{
|
|
52
|
+
key: "cooldownMs",
|
|
53
|
+
label: "Cooldown after end (ms)",
|
|
54
|
+
type: "number",
|
|
55
|
+
min: 0,
|
|
56
|
+
max: 3e3,
|
|
57
|
+
step: 50
|
|
58
|
+
},
|
|
59
|
+
{ key: "minConfidence", label: "Min confidence", type: "number", min: 0, max: 1, step: 0.05 },
|
|
60
|
+
{ key: "lostGraceMs", label: "Loss grace (ms)", type: "number", min: 0, max: 1e3, step: 10 }
|
|
61
|
+
], d = (e, s = o) => ({ ...s, ...e }), b = (e, s) => ({ ...e, ...s });
|
|
62
|
+
export {
|
|
63
|
+
n as D,
|
|
64
|
+
c as G,
|
|
65
|
+
t as H,
|
|
66
|
+
p as a,
|
|
67
|
+
o as b,
|
|
68
|
+
b as c,
|
|
69
|
+
d,
|
|
70
|
+
i as p,
|
|
71
|
+
r,
|
|
72
|
+
m as t
|
|
73
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { XRSubjectAssociation, XRSubjectCandidate, XRSubjectMemory, XRSubjectPolicy, XRSubjectSelection, XRSubjectSelectionResult, } from './types';
|
|
2
|
+
export { DEFAULT_SUBJECT_POLICY, EMPTY_SUBJECT_MEMORY, XR_MAX_SUBJECTS, associateSubjects, faceCandidates, jointCandidates, selectSubject, } from './select';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TrackerPoint } from '../types/common';
|
|
2
|
+
import { XRSubjectAssociation, XRSubjectCandidate, XRSubjectMemory, XRSubjectPolicy, XRSubjectSelectionResult } from './types';
|
|
3
|
+
export declare const DEFAULT_SUBJECT_POLICY: XRSubjectPolicy;
|
|
4
|
+
/**
|
|
5
|
+
* Maximum subjects each tracker can report, and whether the count is a
|
|
6
|
+
* request option. Face: `numFaces` (1 default, raise per consumer; the first
|
|
7
|
+
* acquirer wins). Hand: 2 (fixed). Gesture: 1. Body: 1. Holistic: 1 (single
|
|
8
|
+
* person by design). Segmentation has no subjects.
|
|
9
|
+
*/
|
|
10
|
+
export declare const XR_MAX_SUBJECTS: Readonly<{
|
|
11
|
+
face: {
|
|
12
|
+
max: number;
|
|
13
|
+
default: number;
|
|
14
|
+
option: "numFaces";
|
|
15
|
+
};
|
|
16
|
+
hand: {
|
|
17
|
+
max: number;
|
|
18
|
+
default: number;
|
|
19
|
+
option: null;
|
|
20
|
+
};
|
|
21
|
+
gesture: {
|
|
22
|
+
max: number;
|
|
23
|
+
default: number;
|
|
24
|
+
option: null;
|
|
25
|
+
};
|
|
26
|
+
body: {
|
|
27
|
+
max: number;
|
|
28
|
+
default: number;
|
|
29
|
+
option: null;
|
|
30
|
+
};
|
|
31
|
+
holistic: {
|
|
32
|
+
max: number;
|
|
33
|
+
default: number;
|
|
34
|
+
option: null;
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
export declare const EMPTY_SUBJECT_MEMORY: XRSubjectMemory;
|
|
38
|
+
/**
|
|
39
|
+
* Pick one subject. Pure: feed `result.memory` back on the next frame for
|
|
40
|
+
* `sticky`. `null` index means nothing to select (the consumer should treat
|
|
41
|
+
* it as a dropout and apply its own hold).
|
|
42
|
+
*/
|
|
43
|
+
export declare const selectSubject: (candidates: XRSubjectCandidate[], policy?: XRSubjectPolicy, memory?: XRSubjectMemory) => XRSubjectSelectionResult;
|
|
44
|
+
type Landmark = {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
};
|
|
48
|
+
/** Candidates from face-mesh landmark arrays (feed space): centre and width of the bounds. */
|
|
49
|
+
export declare const faceCandidates: (faces: ReadonlyArray<ReadonlyArray<Landmark>>) => XRSubjectCandidate[];
|
|
50
|
+
/** Candidates from tracker-space joint lists (hands, bodies): centre and span, converted to feed space. */
|
|
51
|
+
export declare const jointCandidates: (subjects: ReadonlyArray<{
|
|
52
|
+
coordinates?: ReadonlyArray<TrackerPoint>;
|
|
53
|
+
label?: string;
|
|
54
|
+
}>) => XRSubjectCandidate[];
|
|
55
|
+
/**
|
|
56
|
+
* Greedy nearest-centre matching between two trackers' subjects (face ↔
|
|
57
|
+
* body, hand ↔ body). Each subject is used once; pairs farther than
|
|
58
|
+
* `maxDistance` (feed units) are not associated. This is the SDK's whole
|
|
59
|
+
* association contract: spatial proximity in the same frame, no identity.
|
|
60
|
+
*/
|
|
61
|
+
export declare const associateSubjects: (primary: XRSubjectCandidate[], secondary: XRSubjectCandidate[], maxDistance?: number) => XRSubjectAssociation[];
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FeedPoint } from '../coordinates/spaces';
|
|
2
|
+
/**
|
|
3
|
+
* How one subject is picked from a tracker's result array.
|
|
4
|
+
*
|
|
5
|
+
* - `index`: the result-array position (`policy.index`, default 0). The
|
|
6
|
+
* SDK's historical behaviour; the position is NOT a persistent identity.
|
|
7
|
+
* - `largest`: the biggest subject (closest to the camera).
|
|
8
|
+
* - `nearest-center`: the subject closest to the feed centre.
|
|
9
|
+
* - `leftmost` / `rightmost`: by feed x (viewer's left / right as shown in the preview).
|
|
10
|
+
* - `sticky`: the subject nearest to the previously selected one (within
|
|
11
|
+
* `stickyRadius`), falling back to `fallback` when none is close enough.
|
|
12
|
+
* This is the SDK's only re-identification: spatial continuity, nothing
|
|
13
|
+
* learned about the person.
|
|
14
|
+
*/
|
|
15
|
+
export type XRSubjectSelection = "index" | "largest" | "nearest-center" | "leftmost" | "rightmost" | "sticky";
|
|
16
|
+
export type XRSubjectPolicy = {
|
|
17
|
+
selection: XRSubjectSelection;
|
|
18
|
+
/** Result-array position for `index`. Default 0. */
|
|
19
|
+
index?: number;
|
|
20
|
+
/** Max feed distance (0..1 units) a `sticky` subject may move between frames. Default 0.2. */
|
|
21
|
+
stickyRadius?: number;
|
|
22
|
+
/** What `sticky` picks when nothing is within the radius (default `largest`). */
|
|
23
|
+
fallback?: Exclude<XRSubjectSelection, "sticky">;
|
|
24
|
+
};
|
|
25
|
+
/** A subject reduced to what selection needs: its feed-space centre and size. */
|
|
26
|
+
export type XRSubjectCandidate = {
|
|
27
|
+
/** Result-array position. */
|
|
28
|
+
index: number;
|
|
29
|
+
/** Feed space (0..1, top-left origin). */
|
|
30
|
+
center: FeedPoint;
|
|
31
|
+
/** Width in feed units (bounds width for faces, span for hands / bodies). */
|
|
32
|
+
size: number;
|
|
33
|
+
/** Extra identity hint the selection may use (e.g. handedness). */
|
|
34
|
+
label?: string;
|
|
35
|
+
};
|
|
36
|
+
export type XRSubjectSelectionResult = {
|
|
37
|
+
/** Selected result-array position, or `null` when there is no candidate. */
|
|
38
|
+
index: number | null;
|
|
39
|
+
/** Which rule decided. */
|
|
40
|
+
reason: XRSubjectSelection | "none" | "sticky-fallback";
|
|
41
|
+
/** Carry to the next call for `sticky`. */
|
|
42
|
+
memory: XRSubjectMemory;
|
|
43
|
+
};
|
|
44
|
+
/** Where the selected subject was last seen (for `sticky`). */
|
|
45
|
+
export type XRSubjectMemory = {
|
|
46
|
+
center: FeedPoint | null;
|
|
47
|
+
label?: string;
|
|
48
|
+
};
|
|
49
|
+
/** A pair of subjects matched across two trackers (face ↔ body, hand ↔ body…). */
|
|
50
|
+
export type XRSubjectAssociation = {
|
|
51
|
+
primaryIndex: number;
|
|
52
|
+
secondaryIndex: number;
|
|
53
|
+
/** Feed-space distance between the matched centres. */
|
|
54
|
+
distance: number;
|
|
55
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { XRProviderProps } from '../components/XRProvider';
|
|
2
|
+
import { XRModel } from '../constants';
|
|
3
|
+
import { XRCameraRequest } from '../types/compositor';
|
|
4
|
+
import { XRTrackerKind, XRTrackingConfig } from './types';
|
|
5
|
+
/** `perf`, `lifecycle` and `quality` for `<XRProvider>`. */
|
|
6
|
+
export declare const toProviderProps: (config: XRTrackingConfig) => Pick<XRProviderProps, "perf" | "lifecycle" | "quality">;
|
|
7
|
+
/** The webcam request for `setMediaSource` / `switchCamera`. */
|
|
8
|
+
export declare const toCameraRequest: (config: XRTrackingConfig) => XRCameraRequest;
|
|
9
|
+
type TrackerProps = {
|
|
10
|
+
face: {
|
|
11
|
+
numFaces: number;
|
|
12
|
+
targetFps?: number;
|
|
13
|
+
holdMs: number;
|
|
14
|
+
predictMs: number;
|
|
15
|
+
active: boolean;
|
|
16
|
+
};
|
|
17
|
+
hand: {
|
|
18
|
+
targetFps?: number;
|
|
19
|
+
active: boolean;
|
|
20
|
+
};
|
|
21
|
+
gesture: {
|
|
22
|
+
targetFps?: number;
|
|
23
|
+
active: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** `<BodyTracker>` has no fps prop; its cap comes from `toModelOptions` / `perf.targetFps`. */
|
|
26
|
+
body: {
|
|
27
|
+
active: boolean;
|
|
28
|
+
};
|
|
29
|
+
holistic: {
|
|
30
|
+
targetFps?: number;
|
|
31
|
+
hands: XRTrackingConfig["trackers"]["holistic"]["hands"];
|
|
32
|
+
holdMs: number;
|
|
33
|
+
predictMs: number;
|
|
34
|
+
analysisMaxDimension: number;
|
|
35
|
+
outputFaceBlendshapes: boolean;
|
|
36
|
+
delegate: XRTrackingConfig["trackers"]["holistic"]["delegate"];
|
|
37
|
+
modelUrl?: string;
|
|
38
|
+
active: boolean;
|
|
39
|
+
};
|
|
40
|
+
segmentation: {
|
|
41
|
+
quality: XRTrackingConfig["trackers"]["segmentation"]["quality"];
|
|
42
|
+
active: boolean;
|
|
43
|
+
};
|
|
44
|
+
semanticSegmentation: {
|
|
45
|
+
preset: XRTrackingConfig["trackers"]["semanticSegmentation"]["preset"];
|
|
46
|
+
quality: XRTrackingConfig["trackers"]["semanticSegmentation"]["quality"];
|
|
47
|
+
modelUrl?: string;
|
|
48
|
+
active: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/** Props for one tracker component / hook from the config (`active` mirrors `enabled`). */
|
|
52
|
+
export declare const toTrackerProps: <K extends XRTrackerKind>(config: XRTrackingConfig, kind: K) => TrackerProps[K];
|
|
53
|
+
/** Acquire options for `useXRModel` / `registry.acquire` per model. */
|
|
54
|
+
export declare const toModelOptions: (config: XRTrackingConfig, model: XRModel) => Record<string, unknown>;
|
|
55
|
+
/** The models the config enables, for capability probes and preloading. */
|
|
56
|
+
export declare const enabledModels: (config: XRTrackingConfig) => XRModel[];
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { XRTrackerKind, XRTrackingConfig, XRTrackingConfigInput, XRTrackingConfigParseResult, } from './types';
|
|
2
|
+
export { DEFAULT_TRACKING_CONFIG, TRACKER_KINDS, TRACKING_CONFIG_VERSION, mergeTrackingConfig, parseTrackingConfig, resolveTrackingConfig, serializeTrackingConfig, } from './resolve';
|
|
3
|
+
export { enabledModels, toCameraRequest, toModelOptions, toProviderProps, toTrackerProps, } from './apply';
|
|
4
|
+
export { TRACKING_CONFIG_STORAGE_KEY, clearTrackingConfig, loadTrackingConfig, saveTrackingConfig, } from './storage';
|
|
5
|
+
export type { TrackingConfigStorage } from './storage';
|
|
6
|
+
export { useXRTrackingConfig } from './useXRTrackingConfig';
|
|
7
|
+
export type { UseXRTrackingConfigOptions, UseXRTrackingConfigResult } from './useXRTrackingConfig';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { XRTrackerKind, XRTrackingConfig, XRTrackingConfigInput, XRTrackingConfigParseResult } from './types';
|
|
2
|
+
export declare const TRACKING_CONFIG_VERSION: 1;
|
|
3
|
+
export declare const DEFAULT_TRACKING_CONFIG: XRTrackingConfig;
|
|
4
|
+
/**
|
|
5
|
+
* Validate a partial config over `base` (the defaults unless given). Every
|
|
6
|
+
* leaf is type-checked and clamped; invalid values keep the base value and
|
|
7
|
+
* add a warning. Returns a new object; never throws.
|
|
8
|
+
*/
|
|
9
|
+
export declare const resolveTrackingConfig: (input?: XRTrackingConfigInput, base?: XRTrackingConfig, warnings?: string[]) => XRTrackingConfig;
|
|
10
|
+
/** Apply a patch over a resolved config (stamps `updatedAt`). */
|
|
11
|
+
export declare const mergeTrackingConfig: (current: XRTrackingConfig, patch: XRTrackingConfigInput, now?: number) => XRTrackingConfig;
|
|
12
|
+
/**
|
|
13
|
+
* Serialize for storage or transport. The config holds no runtime values by
|
|
14
|
+
* construction; this strips anything a caller may have attached and emits
|
|
15
|
+
* stable key order.
|
|
16
|
+
*/
|
|
17
|
+
export declare const serializeTrackingConfig: (config: XRTrackingConfig) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Parse a stored document of any version. Unknown or older versions are
|
|
20
|
+
* migrated field-by-field onto the current defaults (fields that still
|
|
21
|
+
* exist keep their values; the rest default) with `migrated: true`;
|
|
22
|
+
* corrupt input yields the defaults with a warning. Never throws.
|
|
23
|
+
*/
|
|
24
|
+
export declare const parseTrackingConfig: (raw: string | unknown) => XRTrackingConfigParseResult;
|
|
25
|
+
export declare const TRACKER_KINDS: XRTrackerKind[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XRTrackingConfig, XRTrackingConfigParseResult } from './types';
|
|
2
|
+
export declare const TRACKING_CONFIG_STORAGE_KEY = "vincentt.xr.tracking-config";
|
|
3
|
+
export type TrackingConfigStorage = Pick<Storage, "getItem" | "setItem" | "removeItem">;
|
|
4
|
+
/** Read and migrate a stored config; `null` when nothing is stored or storage is unavailable. */
|
|
5
|
+
export declare const loadTrackingConfig: (key?: string, storage?: TrackingConfigStorage | null) => XRTrackingConfigParseResult | null;
|
|
6
|
+
/** Persist (serialized, runtime-free). Returns `false` when storage is unavailable or full. */
|
|
7
|
+
export declare const saveTrackingConfig: (config: XRTrackingConfig, key?: string, storage?: TrackingConfigStorage | null) => boolean;
|
|
8
|
+
export declare const clearTrackingConfig: (key?: string, storage?: TrackingConfigStorage | null) => void;
|