@pose-tracker/pose-estimation-web 0.2.0 → 0.3.1
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/README.md +6 -2
- package/dist/index.cjs +303 -36
- package/dist/index.d.cts +78 -2
- package/dist/index.d.ts +78 -2
- package/dist/index.js +298 -37
- package/dist/pose-tracker.global.js +3 -3
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _tensorflow_tfjs from '@tensorflow/tfjs';
|
|
2
2
|
|
|
3
3
|
/** Bumped with package.json version (keep in sync). */
|
|
4
|
-
declare const SDK_VERSION = "0.
|
|
4
|
+
declare const SDK_VERSION = "0.3.1";
|
|
5
5
|
declare const SDK_NAME: "posetracker-web";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -132,6 +132,8 @@ interface EngineBundleDescriptor {
|
|
|
132
132
|
minSdkVersion: string;
|
|
133
133
|
/** True when the version sent in `localVersions.engine` is already current. */
|
|
134
134
|
upToDate?: boolean;
|
|
135
|
+
/** Which interpreter this descriptor is. Absent on older backends = v3. */
|
|
136
|
+
channel?: 'v3' | 'v4';
|
|
135
137
|
}
|
|
136
138
|
interface PoseRuntimePartDescriptor {
|
|
137
139
|
/** Download URL of this part (`GET /api/sdk/pose-runtime?part=...&v=...`). */
|
|
@@ -172,6 +174,11 @@ interface ConfigureRequest {
|
|
|
172
174
|
poseRuntime?: string | null;
|
|
173
175
|
engine?: string | null;
|
|
174
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Which remote engine to download. New SDKs send `'v4'` by default.
|
|
179
|
+
* Omitted (0.2.x) still means V3 on the server. `'v3'` forces the FSM bundle.
|
|
180
|
+
*/
|
|
181
|
+
engineChannel?: 'v3' | 'v4';
|
|
175
182
|
}
|
|
176
183
|
interface PlanInfo {
|
|
177
184
|
plan: string;
|
|
@@ -202,6 +209,32 @@ interface SdkManifest {
|
|
|
202
209
|
expiresAt: number;
|
|
203
210
|
}
|
|
204
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Engine channel + production squat lock.
|
|
214
|
+
*
|
|
215
|
+
* Default handshake is V4 except unlabeled squat / face_squat (V3 FSM).
|
|
216
|
+
* Explicit `engine: 'v4'` is the only way to run the V4 catalog squat.
|
|
217
|
+
* Explicit `engine: 'v3'` keeps the full V3 bundle.
|
|
218
|
+
* See posetracker-rn-sdk/engine/v4/catalog/SQUAT_PRODUCTION.md
|
|
219
|
+
*/
|
|
220
|
+
type EngineChannel = 'v3' | 'v4';
|
|
221
|
+
/** Movements that exist only in the V4 catalog (not in V3 FSM / Strapi). */
|
|
222
|
+
declare const V4_ONLY_EXERCISE_IDS: readonly ["shoulder_roll", "shoulder_deep_breath", "chair_forward_fold", "chair_side_stretch"];
|
|
223
|
+
declare const PRODUCTION_SQUAT_IDS: readonly ["squat", "face_squat"];
|
|
224
|
+
declare function isProductionSquatId(exerciseId?: string | null): boolean;
|
|
225
|
+
/** Handshake default is V4. Pass `'v3'` to force the V3 bundle. */
|
|
226
|
+
declare function normalizeEngineChannel(raw?: string | null): EngineChannel;
|
|
227
|
+
/**
|
|
228
|
+
* Session interpreter for this id. Production squat stays V3 unless `engine`
|
|
229
|
+
* is explicitly `'v4'`. Other ids follow the handshake (default V4).
|
|
230
|
+
*/
|
|
231
|
+
declare function resolveMovementEngine(opts?: {
|
|
232
|
+
engine?: string | null;
|
|
233
|
+
exercise?: string | null;
|
|
234
|
+
userExercise?: boolean;
|
|
235
|
+
}): EngineChannel;
|
|
236
|
+
declare function requiresEngineV4(exerciseId: string): boolean;
|
|
237
|
+
|
|
205
238
|
/**
|
|
206
239
|
* Handshake client: `configure(apiToken)` → Strapi `SdkManifest`.
|
|
207
240
|
* Same endpoint as RN light; `targetPlatform: 'web'`, `sdkName: posetracker-web`.
|
|
@@ -213,6 +246,12 @@ interface ConfigureOptions {
|
|
|
213
246
|
poseModelProfile?: PoseModelProfile;
|
|
214
247
|
locale?: string;
|
|
215
248
|
localVersions?: ConfigureRequest['localVersions'];
|
|
249
|
+
/**
|
|
250
|
+
* Remote engine channel. Default `'v4'`. Pass `'v3'` for the production FSM
|
|
251
|
+
* bundle. Unlabeled `startExercise('squat')` stays on the V3 squat FSM even
|
|
252
|
+
* on the V4 channel unless `engine` is explicitly `'v4'`.
|
|
253
|
+
*/
|
|
254
|
+
engine?: EngineChannel;
|
|
216
255
|
}
|
|
217
256
|
declare class ConfigureError extends Error {
|
|
218
257
|
readonly code: 'invalid_token' | 'quota_exceeded' | 'network' | 'internal';
|
|
@@ -679,6 +718,11 @@ interface EngineSessionOptions {
|
|
|
679
718
|
minGrade?: MinGrade;
|
|
680
719
|
/** Emission flags — engines older than 1.1.0 ignore them (client re-filters). */
|
|
681
720
|
features?: EngineSessionFeatures;
|
|
721
|
+
/**
|
|
722
|
+
* Run the V4 catalog squat instead of the production V3 FSM.
|
|
723
|
+
* Set when the host passed `engine: 'v4'` explicitly.
|
|
724
|
+
*/
|
|
725
|
+
v4CatalogSquat?: boolean;
|
|
682
726
|
}
|
|
683
727
|
interface EngineSession {
|
|
684
728
|
/** Feed one estimated pose; the session emits events through the sink. */
|
|
@@ -716,6 +760,13 @@ interface PoseTrackerEngine {
|
|
|
716
760
|
createSession(options: EngineSessionOptions, emit: EventSink): EngineSession;
|
|
717
761
|
/** Engine >= 1.2.0: custom exercises shipped in the bundle (jump analysis…). */
|
|
718
762
|
listCustomExercises?(): CustomExerciseDescriptor[];
|
|
763
|
+
/** Engine V4 catalog (opt-in channel). Absent on V3 bundles. */
|
|
764
|
+
listExercises?(): Array<{
|
|
765
|
+
id: string;
|
|
766
|
+
displayName: string;
|
|
767
|
+
type: string;
|
|
768
|
+
description?: string;
|
|
769
|
+
}>;
|
|
719
770
|
/** Engine >= 1.2.0: start a custom exercise session (placement + jump_* events). */
|
|
720
771
|
createCustomSession?(options: CustomSessionOptions, emit: EventSink): EngineSession;
|
|
721
772
|
}
|
|
@@ -1008,6 +1059,12 @@ interface PoseTrackerClientOptions extends ConfigureOptions {
|
|
|
1008
1059
|
/** Convenience with `source: 'video' | 'image'` (string / File / Blob). */
|
|
1009
1060
|
sourceUrl?: string;
|
|
1010
1061
|
sourceFile?: File | Blob;
|
|
1062
|
+
/**
|
|
1063
|
+
* Still-image inference. Default `single`: one full-frame SinglePose pass
|
|
1064
|
+
* (no EMA / no ROI). `tracked`: treat analyze() as video frames — EMA +
|
|
1065
|
+
* previous-pose crop so each shot can refine the last skeleton.
|
|
1066
|
+
*/
|
|
1067
|
+
stillMode?: 'single' | 'tracked';
|
|
1011
1068
|
}
|
|
1012
1069
|
/** @deprecated Prefer PoseTrackerClientOptions — kept for vanilla DX. */
|
|
1013
1070
|
type PoseTrackerOptions = PoseTrackerClientOptions;
|
|
@@ -1108,8 +1165,11 @@ declare class PoseTrackerClient {
|
|
|
1108
1165
|
dispose(): Promise<void>;
|
|
1109
1166
|
configure(apiToken?: string): Promise<boolean>;
|
|
1110
1167
|
getAvailableExercises(): ExerciseConfig[];
|
|
1168
|
+
getEngineChannel(): EngineChannel;
|
|
1169
|
+
private v4ExerciseConfig;
|
|
1111
1170
|
getAvailableCustomExercises(): CustomExerciseDescriptor[];
|
|
1112
1171
|
startExercise(exerciseId: string, options?: StartExerciseOptions): void;
|
|
1172
|
+
private beginEngineSession;
|
|
1113
1173
|
private startCustomExercise;
|
|
1114
1174
|
stopExercise(): void;
|
|
1115
1175
|
getCurrentExerciseId(): string | null;
|
|
@@ -1161,6 +1221,9 @@ interface Letterbox {
|
|
|
1161
1221
|
drawH: number;
|
|
1162
1222
|
vw: number;
|
|
1163
1223
|
vh: number;
|
|
1224
|
+
/** Window top-left in original media pixels (still-image video simulation). */
|
|
1225
|
+
originX?: number;
|
|
1226
|
+
originY?: number;
|
|
1164
1227
|
}
|
|
1165
1228
|
interface DetectorFrameResult {
|
|
1166
1229
|
/** Raw model output used for skeleton mapping (MoveNet: Float32Array length 51). */
|
|
@@ -1191,7 +1254,11 @@ interface PoseDetectorAdapter {
|
|
|
1191
1254
|
facingMode: 'user' | 'environment';
|
|
1192
1255
|
displayWidth: number;
|
|
1193
1256
|
displayHeight: number;
|
|
1257
|
+
/** EMA across frames. Default true. Stills may pass true to simulate a short clip. */
|
|
1258
|
+
temporalSmooth?: boolean;
|
|
1194
1259
|
}): Promise<DetectorFrameResult | null>;
|
|
1260
|
+
/** Optional: clear temporal filters when the media source changes. */
|
|
1261
|
+
resetTemporal?(): void;
|
|
1195
1262
|
dispose(): void;
|
|
1196
1263
|
}
|
|
1197
1264
|
interface CreateAdapterContext {
|
|
@@ -1211,6 +1278,9 @@ declare class MoveNetGraphAdapter implements PoseDetectorAdapter {
|
|
|
1211
1278
|
private offscreen;
|
|
1212
1279
|
private offCtx;
|
|
1213
1280
|
private smoothed;
|
|
1281
|
+
private lastVideoKps;
|
|
1282
|
+
private stillPass;
|
|
1283
|
+
private inferLb;
|
|
1214
1284
|
private letterbox;
|
|
1215
1285
|
constructor(ctx: CreateAdapterContext);
|
|
1216
1286
|
getBackend(): string | null;
|
|
@@ -1222,7 +1292,10 @@ declare class MoveNetGraphAdapter implements PoseDetectorAdapter {
|
|
|
1222
1292
|
facingMode: 'user' | 'environment';
|
|
1223
1293
|
displayWidth: number;
|
|
1224
1294
|
displayHeight: number;
|
|
1295
|
+
temporalSmooth?: boolean;
|
|
1225
1296
|
}): Promise<DetectorFrameResult | null>;
|
|
1297
|
+
/** Clear EMA state (call when the still / clip changes). */
|
|
1298
|
+
resetTemporal(): void;
|
|
1226
1299
|
dispose(): void;
|
|
1227
1300
|
}
|
|
1228
1301
|
/** Map video keypoints → object-fit:cover display pixels for drawing. */
|
|
@@ -1251,7 +1324,10 @@ declare class BlazePoseAdapter implements PoseDetectorAdapter {
|
|
|
1251
1324
|
facingMode: 'user' | 'environment';
|
|
1252
1325
|
displayWidth: number;
|
|
1253
1326
|
displayHeight: number;
|
|
1327
|
+
temporalSmooth?: boolean;
|
|
1254
1328
|
}): Promise<DetectorFrameResult | null>;
|
|
1329
|
+
/** Clear cached ROI / landmark filters (call when the still changes). */
|
|
1330
|
+
resetTemporal(): void;
|
|
1255
1331
|
dispose(): void;
|
|
1256
1332
|
}
|
|
1257
1333
|
|
|
@@ -1411,4 +1487,4 @@ declare function findExerciseByIdOrAlias<T extends {
|
|
|
1411
1487
|
id: string;
|
|
1412
1488
|
}>(exerciseId: string, exercises: readonly T[]): T | undefined;
|
|
1413
1489
|
|
|
1414
|
-
export { type AccelerationDiagnostics, type AccelerationState, type AngleValue, type AnglesEvent, BRAND_COLORS, BlazePoseAdapter, type BlazePoseModelType, COCO_KEYPOINT_NAMES, COMBINED_REFERENCE_EXERCISE_MESSAGE, type CameraFacingMode, type CameraOptions, type CameraPoseSource, type ClassicMessageListener, type ClassicNativeMessage, type CocoKeypointName, type ColdStartMode, ConfigureError, type ConfigureOptions, type ConfigureRequest, type CounterEvent, type CounterFormScore, type CustomExerciseDescriptor, type CustomSessionOptions, DEFAULT_BASE_URL, DEFAULT_FEATURES, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, DEFAULT_SKELETON, DEFAULT_SKELETON_DEFINITION, type DetectorFrameResult, type DiagnosticListener, EXERCISE_ALIASES, type EngineBundleDescriptor, type EngineLoadResult, EngineLoader, type EngineLoaderOptions, type EngineSession, type EngineSessionFeatures, type EngineSessionOptions, type ErrorEvent, type EventSink, type ExerciseConfig, type ExerciseSummaryEvent, FREE_PLAN_FEATURES_MESSAGE, type FetchSkeletonOptions, type FileStore, type FormGrade, type FormScoreEvent, INVALID_TOKEN_MESSAGE, type ImagePoseSource, type InferenceRuntime, type InitialPosture, type InitializationEvent, type InitializationStep, type JumpCalibrationEvent, type JumpDiscardedEvent, type JumpHeightEvent, type JumpResultEvent, type JumpStartedEvent, type JumpSummaryEntry, type JumpSummaryEvent, type KeyValueStore, type Keypoint, type KeypointName, type KeypointsEvent, type MinGrade, type ModelDescriptor, type ModelFormat, type ModelsByProfile, MoveNetGraphAdapter, type MovementDefinition, type MovementRecommendation, type MovementStep, type MovementStepParameter, ONLINE_POSE_DETECTION_VERSION, ONLINE_TFJS_VERSION, POSETRACKER_LOGO_URL, type PerformanceWarningEvent, type PlanInfo, type Pose, PoseCamera, PoseCamera_mount, type PoseDetectionModule, type PoseDetectorAdapter, type PoseEstimateInput, type PoseModelAlias, type PoseModelKind, type PoseModelProfile, type PoseRuntimeDescriptor, type PoseRuntimePartDescriptor, type PoseSource, type PoseSourceProps, type PoseSourceType, type PoseTracker, type PoseTrackerCallbacks, PoseTrackerClient, type PoseTrackerClientOptions, type PoseTrackerEngine, type PoseTrackerEvent, type PoseTrackerEventListener, type PoseTrackerEventType, type PoseTrackerFeatures, type PoseTrackerMode, type PoseTrackerOptions, type PoseTrackerStatus, type PostureEvent, type PreloadOptions, type ProgressionEvent, type QualityChangedEvent, type RecommendationsEvent, type ReferenceMovementDescriptor, type RepSummary, type ResolvePoseModelOptions, type ResolvedFeatures, type ResolvedPoseModel, type RuntimeDownloadProgressEvent, SDK_NAME, SDK_VERSION, type SdkManifest, type SkeletonAnglesStyle, type SkeletonCirclesStyle, type SkeletonDefinition, SkeletonFetchError, type SkeletonLinesStyle, type StartExerciseOptions, type StatsEvent, type TfModule, type TfjsCdnUrls, TrackError, type TrackRequest, type TrackResponse, UsageTracker, type UsageTrackerOptions, type VideoPoseSource, type VisibleHipsInfo, type WarningEvent, configure, createLocalFileStore, createLocalKeyValueStore, createMemoryFileStore, createPoseAdapter, createPoseTracker, createWebFileStore, defaultPoseDetectionCdnUrl, defaultTfjsCdnUrls, drawSkeleton, featureNotSupportedMessage, fetchSkeletonDefinition, findExerciseByIdOrAlias, freeBlockedFeatures, initWebGlBackend, isPaidPlan, mapVideoKeypointsToDisplay, mountDomShell, normalizePoseSource, openCameraStream, resolveExerciseName, resolveFeatures, resolvePoseDetection, resolvePoseModel, resolveTf, shouldShowWatermark, stopMediaStream, toClassicNativeMessage };
|
|
1490
|
+
export { type AccelerationDiagnostics, type AccelerationState, type AngleValue, type AnglesEvent, BRAND_COLORS, BlazePoseAdapter, type BlazePoseModelType, COCO_KEYPOINT_NAMES, COMBINED_REFERENCE_EXERCISE_MESSAGE, type CameraFacingMode, type CameraOptions, type CameraPoseSource, type ClassicMessageListener, type ClassicNativeMessage, type CocoKeypointName, type ColdStartMode, ConfigureError, type ConfigureOptions, type ConfigureRequest, type CounterEvent, type CounterFormScore, type CustomExerciseDescriptor, type CustomSessionOptions, DEFAULT_BASE_URL, DEFAULT_FEATURES, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, DEFAULT_SKELETON, DEFAULT_SKELETON_DEFINITION, type DetectorFrameResult, type DiagnosticListener, EXERCISE_ALIASES, type EngineBundleDescriptor, type EngineChannel, type EngineLoadResult, EngineLoader, type EngineLoaderOptions, type EngineSession, type EngineSessionFeatures, type EngineSessionOptions, type ErrorEvent, type EventSink, type ExerciseConfig, type ExerciseSummaryEvent, FREE_PLAN_FEATURES_MESSAGE, type FetchSkeletonOptions, type FileStore, type FormGrade, type FormScoreEvent, INVALID_TOKEN_MESSAGE, type ImagePoseSource, type InferenceRuntime, type InitialPosture, type InitializationEvent, type InitializationStep, type JumpCalibrationEvent, type JumpDiscardedEvent, type JumpHeightEvent, type JumpResultEvent, type JumpStartedEvent, type JumpSummaryEntry, type JumpSummaryEvent, type KeyValueStore, type Keypoint, type KeypointName, type KeypointsEvent, type MinGrade, type ModelDescriptor, type ModelFormat, type ModelsByProfile, MoveNetGraphAdapter, type MovementDefinition, type MovementRecommendation, type MovementStep, type MovementStepParameter, ONLINE_POSE_DETECTION_VERSION, ONLINE_TFJS_VERSION, POSETRACKER_LOGO_URL, PRODUCTION_SQUAT_IDS, type PerformanceWarningEvent, type PlanInfo, type Pose, PoseCamera, PoseCamera_mount, type PoseDetectionModule, type PoseDetectorAdapter, type PoseEstimateInput, type PoseModelAlias, type PoseModelKind, type PoseModelProfile, type PoseRuntimeDescriptor, type PoseRuntimePartDescriptor, type PoseSource, type PoseSourceProps, type PoseSourceType, type PoseTracker, type PoseTrackerCallbacks, PoseTrackerClient, type PoseTrackerClientOptions, type PoseTrackerEngine, type PoseTrackerEvent, type PoseTrackerEventListener, type PoseTrackerEventType, type PoseTrackerFeatures, type PoseTrackerMode, type PoseTrackerOptions, type PoseTrackerStatus, type PostureEvent, type PreloadOptions, type ProgressionEvent, type QualityChangedEvent, type RecommendationsEvent, type ReferenceMovementDescriptor, type RepSummary, type ResolvePoseModelOptions, type ResolvedFeatures, type ResolvedPoseModel, type RuntimeDownloadProgressEvent, SDK_NAME, SDK_VERSION, type SdkManifest, type SkeletonAnglesStyle, type SkeletonCirclesStyle, type SkeletonDefinition, SkeletonFetchError, type SkeletonLinesStyle, type StartExerciseOptions, type StatsEvent, type TfModule, type TfjsCdnUrls, TrackError, type TrackRequest, type TrackResponse, UsageTracker, type UsageTrackerOptions, V4_ONLY_EXERCISE_IDS, type VideoPoseSource, type VisibleHipsInfo, type WarningEvent, configure, createLocalFileStore, createLocalKeyValueStore, createMemoryFileStore, createPoseAdapter, createPoseTracker, createWebFileStore, defaultPoseDetectionCdnUrl, defaultTfjsCdnUrls, drawSkeleton, featureNotSupportedMessage, fetchSkeletonDefinition, findExerciseByIdOrAlias, freeBlockedFeatures, initWebGlBackend, isPaidPlan, isProductionSquatId, mapVideoKeypointsToDisplay, mountDomShell, normalizeEngineChannel, normalizePoseSource, openCameraStream, requiresEngineV4, resolveExerciseName, resolveFeatures, resolveMovementEngine, resolvePoseDetection, resolvePoseModel, resolveTf, shouldShowWatermark, stopMediaStream, toClassicNativeMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _tensorflow_tfjs from '@tensorflow/tfjs';
|
|
2
2
|
|
|
3
3
|
/** Bumped with package.json version (keep in sync). */
|
|
4
|
-
declare const SDK_VERSION = "0.
|
|
4
|
+
declare const SDK_VERSION = "0.3.1";
|
|
5
5
|
declare const SDK_NAME: "posetracker-web";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -132,6 +132,8 @@ interface EngineBundleDescriptor {
|
|
|
132
132
|
minSdkVersion: string;
|
|
133
133
|
/** True when the version sent in `localVersions.engine` is already current. */
|
|
134
134
|
upToDate?: boolean;
|
|
135
|
+
/** Which interpreter this descriptor is. Absent on older backends = v3. */
|
|
136
|
+
channel?: 'v3' | 'v4';
|
|
135
137
|
}
|
|
136
138
|
interface PoseRuntimePartDescriptor {
|
|
137
139
|
/** Download URL of this part (`GET /api/sdk/pose-runtime?part=...&v=...`). */
|
|
@@ -172,6 +174,11 @@ interface ConfigureRequest {
|
|
|
172
174
|
poseRuntime?: string | null;
|
|
173
175
|
engine?: string | null;
|
|
174
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Which remote engine to download. New SDKs send `'v4'` by default.
|
|
179
|
+
* Omitted (0.2.x) still means V3 on the server. `'v3'` forces the FSM bundle.
|
|
180
|
+
*/
|
|
181
|
+
engineChannel?: 'v3' | 'v4';
|
|
175
182
|
}
|
|
176
183
|
interface PlanInfo {
|
|
177
184
|
plan: string;
|
|
@@ -202,6 +209,32 @@ interface SdkManifest {
|
|
|
202
209
|
expiresAt: number;
|
|
203
210
|
}
|
|
204
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Engine channel + production squat lock.
|
|
214
|
+
*
|
|
215
|
+
* Default handshake is V4 except unlabeled squat / face_squat (V3 FSM).
|
|
216
|
+
* Explicit `engine: 'v4'` is the only way to run the V4 catalog squat.
|
|
217
|
+
* Explicit `engine: 'v3'` keeps the full V3 bundle.
|
|
218
|
+
* See posetracker-rn-sdk/engine/v4/catalog/SQUAT_PRODUCTION.md
|
|
219
|
+
*/
|
|
220
|
+
type EngineChannel = 'v3' | 'v4';
|
|
221
|
+
/** Movements that exist only in the V4 catalog (not in V3 FSM / Strapi). */
|
|
222
|
+
declare const V4_ONLY_EXERCISE_IDS: readonly ["shoulder_roll", "shoulder_deep_breath", "chair_forward_fold", "chair_side_stretch"];
|
|
223
|
+
declare const PRODUCTION_SQUAT_IDS: readonly ["squat", "face_squat"];
|
|
224
|
+
declare function isProductionSquatId(exerciseId?: string | null): boolean;
|
|
225
|
+
/** Handshake default is V4. Pass `'v3'` to force the V3 bundle. */
|
|
226
|
+
declare function normalizeEngineChannel(raw?: string | null): EngineChannel;
|
|
227
|
+
/**
|
|
228
|
+
* Session interpreter for this id. Production squat stays V3 unless `engine`
|
|
229
|
+
* is explicitly `'v4'`. Other ids follow the handshake (default V4).
|
|
230
|
+
*/
|
|
231
|
+
declare function resolveMovementEngine(opts?: {
|
|
232
|
+
engine?: string | null;
|
|
233
|
+
exercise?: string | null;
|
|
234
|
+
userExercise?: boolean;
|
|
235
|
+
}): EngineChannel;
|
|
236
|
+
declare function requiresEngineV4(exerciseId: string): boolean;
|
|
237
|
+
|
|
205
238
|
/**
|
|
206
239
|
* Handshake client: `configure(apiToken)` → Strapi `SdkManifest`.
|
|
207
240
|
* Same endpoint as RN light; `targetPlatform: 'web'`, `sdkName: posetracker-web`.
|
|
@@ -213,6 +246,12 @@ interface ConfigureOptions {
|
|
|
213
246
|
poseModelProfile?: PoseModelProfile;
|
|
214
247
|
locale?: string;
|
|
215
248
|
localVersions?: ConfigureRequest['localVersions'];
|
|
249
|
+
/**
|
|
250
|
+
* Remote engine channel. Default `'v4'`. Pass `'v3'` for the production FSM
|
|
251
|
+
* bundle. Unlabeled `startExercise('squat')` stays on the V3 squat FSM even
|
|
252
|
+
* on the V4 channel unless `engine` is explicitly `'v4'`.
|
|
253
|
+
*/
|
|
254
|
+
engine?: EngineChannel;
|
|
216
255
|
}
|
|
217
256
|
declare class ConfigureError extends Error {
|
|
218
257
|
readonly code: 'invalid_token' | 'quota_exceeded' | 'network' | 'internal';
|
|
@@ -679,6 +718,11 @@ interface EngineSessionOptions {
|
|
|
679
718
|
minGrade?: MinGrade;
|
|
680
719
|
/** Emission flags — engines older than 1.1.0 ignore them (client re-filters). */
|
|
681
720
|
features?: EngineSessionFeatures;
|
|
721
|
+
/**
|
|
722
|
+
* Run the V4 catalog squat instead of the production V3 FSM.
|
|
723
|
+
* Set when the host passed `engine: 'v4'` explicitly.
|
|
724
|
+
*/
|
|
725
|
+
v4CatalogSquat?: boolean;
|
|
682
726
|
}
|
|
683
727
|
interface EngineSession {
|
|
684
728
|
/** Feed one estimated pose; the session emits events through the sink. */
|
|
@@ -716,6 +760,13 @@ interface PoseTrackerEngine {
|
|
|
716
760
|
createSession(options: EngineSessionOptions, emit: EventSink): EngineSession;
|
|
717
761
|
/** Engine >= 1.2.0: custom exercises shipped in the bundle (jump analysis…). */
|
|
718
762
|
listCustomExercises?(): CustomExerciseDescriptor[];
|
|
763
|
+
/** Engine V4 catalog (opt-in channel). Absent on V3 bundles. */
|
|
764
|
+
listExercises?(): Array<{
|
|
765
|
+
id: string;
|
|
766
|
+
displayName: string;
|
|
767
|
+
type: string;
|
|
768
|
+
description?: string;
|
|
769
|
+
}>;
|
|
719
770
|
/** Engine >= 1.2.0: start a custom exercise session (placement + jump_* events). */
|
|
720
771
|
createCustomSession?(options: CustomSessionOptions, emit: EventSink): EngineSession;
|
|
721
772
|
}
|
|
@@ -1008,6 +1059,12 @@ interface PoseTrackerClientOptions extends ConfigureOptions {
|
|
|
1008
1059
|
/** Convenience with `source: 'video' | 'image'` (string / File / Blob). */
|
|
1009
1060
|
sourceUrl?: string;
|
|
1010
1061
|
sourceFile?: File | Blob;
|
|
1062
|
+
/**
|
|
1063
|
+
* Still-image inference. Default `single`: one full-frame SinglePose pass
|
|
1064
|
+
* (no EMA / no ROI). `tracked`: treat analyze() as video frames — EMA +
|
|
1065
|
+
* previous-pose crop so each shot can refine the last skeleton.
|
|
1066
|
+
*/
|
|
1067
|
+
stillMode?: 'single' | 'tracked';
|
|
1011
1068
|
}
|
|
1012
1069
|
/** @deprecated Prefer PoseTrackerClientOptions — kept for vanilla DX. */
|
|
1013
1070
|
type PoseTrackerOptions = PoseTrackerClientOptions;
|
|
@@ -1108,8 +1165,11 @@ declare class PoseTrackerClient {
|
|
|
1108
1165
|
dispose(): Promise<void>;
|
|
1109
1166
|
configure(apiToken?: string): Promise<boolean>;
|
|
1110
1167
|
getAvailableExercises(): ExerciseConfig[];
|
|
1168
|
+
getEngineChannel(): EngineChannel;
|
|
1169
|
+
private v4ExerciseConfig;
|
|
1111
1170
|
getAvailableCustomExercises(): CustomExerciseDescriptor[];
|
|
1112
1171
|
startExercise(exerciseId: string, options?: StartExerciseOptions): void;
|
|
1172
|
+
private beginEngineSession;
|
|
1113
1173
|
private startCustomExercise;
|
|
1114
1174
|
stopExercise(): void;
|
|
1115
1175
|
getCurrentExerciseId(): string | null;
|
|
@@ -1161,6 +1221,9 @@ interface Letterbox {
|
|
|
1161
1221
|
drawH: number;
|
|
1162
1222
|
vw: number;
|
|
1163
1223
|
vh: number;
|
|
1224
|
+
/** Window top-left in original media pixels (still-image video simulation). */
|
|
1225
|
+
originX?: number;
|
|
1226
|
+
originY?: number;
|
|
1164
1227
|
}
|
|
1165
1228
|
interface DetectorFrameResult {
|
|
1166
1229
|
/** Raw model output used for skeleton mapping (MoveNet: Float32Array length 51). */
|
|
@@ -1191,7 +1254,11 @@ interface PoseDetectorAdapter {
|
|
|
1191
1254
|
facingMode: 'user' | 'environment';
|
|
1192
1255
|
displayWidth: number;
|
|
1193
1256
|
displayHeight: number;
|
|
1257
|
+
/** EMA across frames. Default true. Stills may pass true to simulate a short clip. */
|
|
1258
|
+
temporalSmooth?: boolean;
|
|
1194
1259
|
}): Promise<DetectorFrameResult | null>;
|
|
1260
|
+
/** Optional: clear temporal filters when the media source changes. */
|
|
1261
|
+
resetTemporal?(): void;
|
|
1195
1262
|
dispose(): void;
|
|
1196
1263
|
}
|
|
1197
1264
|
interface CreateAdapterContext {
|
|
@@ -1211,6 +1278,9 @@ declare class MoveNetGraphAdapter implements PoseDetectorAdapter {
|
|
|
1211
1278
|
private offscreen;
|
|
1212
1279
|
private offCtx;
|
|
1213
1280
|
private smoothed;
|
|
1281
|
+
private lastVideoKps;
|
|
1282
|
+
private stillPass;
|
|
1283
|
+
private inferLb;
|
|
1214
1284
|
private letterbox;
|
|
1215
1285
|
constructor(ctx: CreateAdapterContext);
|
|
1216
1286
|
getBackend(): string | null;
|
|
@@ -1222,7 +1292,10 @@ declare class MoveNetGraphAdapter implements PoseDetectorAdapter {
|
|
|
1222
1292
|
facingMode: 'user' | 'environment';
|
|
1223
1293
|
displayWidth: number;
|
|
1224
1294
|
displayHeight: number;
|
|
1295
|
+
temporalSmooth?: boolean;
|
|
1225
1296
|
}): Promise<DetectorFrameResult | null>;
|
|
1297
|
+
/** Clear EMA state (call when the still / clip changes). */
|
|
1298
|
+
resetTemporal(): void;
|
|
1226
1299
|
dispose(): void;
|
|
1227
1300
|
}
|
|
1228
1301
|
/** Map video keypoints → object-fit:cover display pixels for drawing. */
|
|
@@ -1251,7 +1324,10 @@ declare class BlazePoseAdapter implements PoseDetectorAdapter {
|
|
|
1251
1324
|
facingMode: 'user' | 'environment';
|
|
1252
1325
|
displayWidth: number;
|
|
1253
1326
|
displayHeight: number;
|
|
1327
|
+
temporalSmooth?: boolean;
|
|
1254
1328
|
}): Promise<DetectorFrameResult | null>;
|
|
1329
|
+
/** Clear cached ROI / landmark filters (call when the still changes). */
|
|
1330
|
+
resetTemporal(): void;
|
|
1255
1331
|
dispose(): void;
|
|
1256
1332
|
}
|
|
1257
1333
|
|
|
@@ -1411,4 +1487,4 @@ declare function findExerciseByIdOrAlias<T extends {
|
|
|
1411
1487
|
id: string;
|
|
1412
1488
|
}>(exerciseId: string, exercises: readonly T[]): T | undefined;
|
|
1413
1489
|
|
|
1414
|
-
export { type AccelerationDiagnostics, type AccelerationState, type AngleValue, type AnglesEvent, BRAND_COLORS, BlazePoseAdapter, type BlazePoseModelType, COCO_KEYPOINT_NAMES, COMBINED_REFERENCE_EXERCISE_MESSAGE, type CameraFacingMode, type CameraOptions, type CameraPoseSource, type ClassicMessageListener, type ClassicNativeMessage, type CocoKeypointName, type ColdStartMode, ConfigureError, type ConfigureOptions, type ConfigureRequest, type CounterEvent, type CounterFormScore, type CustomExerciseDescriptor, type CustomSessionOptions, DEFAULT_BASE_URL, DEFAULT_FEATURES, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, DEFAULT_SKELETON, DEFAULT_SKELETON_DEFINITION, type DetectorFrameResult, type DiagnosticListener, EXERCISE_ALIASES, type EngineBundleDescriptor, type EngineLoadResult, EngineLoader, type EngineLoaderOptions, type EngineSession, type EngineSessionFeatures, type EngineSessionOptions, type ErrorEvent, type EventSink, type ExerciseConfig, type ExerciseSummaryEvent, FREE_PLAN_FEATURES_MESSAGE, type FetchSkeletonOptions, type FileStore, type FormGrade, type FormScoreEvent, INVALID_TOKEN_MESSAGE, type ImagePoseSource, type InferenceRuntime, type InitialPosture, type InitializationEvent, type InitializationStep, type JumpCalibrationEvent, type JumpDiscardedEvent, type JumpHeightEvent, type JumpResultEvent, type JumpStartedEvent, type JumpSummaryEntry, type JumpSummaryEvent, type KeyValueStore, type Keypoint, type KeypointName, type KeypointsEvent, type MinGrade, type ModelDescriptor, type ModelFormat, type ModelsByProfile, MoveNetGraphAdapter, type MovementDefinition, type MovementRecommendation, type MovementStep, type MovementStepParameter, ONLINE_POSE_DETECTION_VERSION, ONLINE_TFJS_VERSION, POSETRACKER_LOGO_URL, type PerformanceWarningEvent, type PlanInfo, type Pose, PoseCamera, PoseCamera_mount, type PoseDetectionModule, type PoseDetectorAdapter, type PoseEstimateInput, type PoseModelAlias, type PoseModelKind, type PoseModelProfile, type PoseRuntimeDescriptor, type PoseRuntimePartDescriptor, type PoseSource, type PoseSourceProps, type PoseSourceType, type PoseTracker, type PoseTrackerCallbacks, PoseTrackerClient, type PoseTrackerClientOptions, type PoseTrackerEngine, type PoseTrackerEvent, type PoseTrackerEventListener, type PoseTrackerEventType, type PoseTrackerFeatures, type PoseTrackerMode, type PoseTrackerOptions, type PoseTrackerStatus, type PostureEvent, type PreloadOptions, type ProgressionEvent, type QualityChangedEvent, type RecommendationsEvent, type ReferenceMovementDescriptor, type RepSummary, type ResolvePoseModelOptions, type ResolvedFeatures, type ResolvedPoseModel, type RuntimeDownloadProgressEvent, SDK_NAME, SDK_VERSION, type SdkManifest, type SkeletonAnglesStyle, type SkeletonCirclesStyle, type SkeletonDefinition, SkeletonFetchError, type SkeletonLinesStyle, type StartExerciseOptions, type StatsEvent, type TfModule, type TfjsCdnUrls, TrackError, type TrackRequest, type TrackResponse, UsageTracker, type UsageTrackerOptions, type VideoPoseSource, type VisibleHipsInfo, type WarningEvent, configure, createLocalFileStore, createLocalKeyValueStore, createMemoryFileStore, createPoseAdapter, createPoseTracker, createWebFileStore, defaultPoseDetectionCdnUrl, defaultTfjsCdnUrls, drawSkeleton, featureNotSupportedMessage, fetchSkeletonDefinition, findExerciseByIdOrAlias, freeBlockedFeatures, initWebGlBackend, isPaidPlan, mapVideoKeypointsToDisplay, mountDomShell, normalizePoseSource, openCameraStream, resolveExerciseName, resolveFeatures, resolvePoseDetection, resolvePoseModel, resolveTf, shouldShowWatermark, stopMediaStream, toClassicNativeMessage };
|
|
1490
|
+
export { type AccelerationDiagnostics, type AccelerationState, type AngleValue, type AnglesEvent, BRAND_COLORS, BlazePoseAdapter, type BlazePoseModelType, COCO_KEYPOINT_NAMES, COMBINED_REFERENCE_EXERCISE_MESSAGE, type CameraFacingMode, type CameraOptions, type CameraPoseSource, type ClassicMessageListener, type ClassicNativeMessage, type CocoKeypointName, type ColdStartMode, ConfigureError, type ConfigureOptions, type ConfigureRequest, type CounterEvent, type CounterFormScore, type CustomExerciseDescriptor, type CustomSessionOptions, DEFAULT_BASE_URL, DEFAULT_FEATURES, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, DEFAULT_SKELETON, DEFAULT_SKELETON_DEFINITION, type DetectorFrameResult, type DiagnosticListener, EXERCISE_ALIASES, type EngineBundleDescriptor, type EngineChannel, type EngineLoadResult, EngineLoader, type EngineLoaderOptions, type EngineSession, type EngineSessionFeatures, type EngineSessionOptions, type ErrorEvent, type EventSink, type ExerciseConfig, type ExerciseSummaryEvent, FREE_PLAN_FEATURES_MESSAGE, type FetchSkeletonOptions, type FileStore, type FormGrade, type FormScoreEvent, INVALID_TOKEN_MESSAGE, type ImagePoseSource, type InferenceRuntime, type InitialPosture, type InitializationEvent, type InitializationStep, type JumpCalibrationEvent, type JumpDiscardedEvent, type JumpHeightEvent, type JumpResultEvent, type JumpStartedEvent, type JumpSummaryEntry, type JumpSummaryEvent, type KeyValueStore, type Keypoint, type KeypointName, type KeypointsEvent, type MinGrade, type ModelDescriptor, type ModelFormat, type ModelsByProfile, MoveNetGraphAdapter, type MovementDefinition, type MovementRecommendation, type MovementStep, type MovementStepParameter, ONLINE_POSE_DETECTION_VERSION, ONLINE_TFJS_VERSION, POSETRACKER_LOGO_URL, PRODUCTION_SQUAT_IDS, type PerformanceWarningEvent, type PlanInfo, type Pose, PoseCamera, PoseCamera_mount, type PoseDetectionModule, type PoseDetectorAdapter, type PoseEstimateInput, type PoseModelAlias, type PoseModelKind, type PoseModelProfile, type PoseRuntimeDescriptor, type PoseRuntimePartDescriptor, type PoseSource, type PoseSourceProps, type PoseSourceType, type PoseTracker, type PoseTrackerCallbacks, PoseTrackerClient, type PoseTrackerClientOptions, type PoseTrackerEngine, type PoseTrackerEvent, type PoseTrackerEventListener, type PoseTrackerEventType, type PoseTrackerFeatures, type PoseTrackerMode, type PoseTrackerOptions, type PoseTrackerStatus, type PostureEvent, type PreloadOptions, type ProgressionEvent, type QualityChangedEvent, type RecommendationsEvent, type ReferenceMovementDescriptor, type RepSummary, type ResolvePoseModelOptions, type ResolvedFeatures, type ResolvedPoseModel, type RuntimeDownloadProgressEvent, SDK_NAME, SDK_VERSION, type SdkManifest, type SkeletonAnglesStyle, type SkeletonCirclesStyle, type SkeletonDefinition, SkeletonFetchError, type SkeletonLinesStyle, type StartExerciseOptions, type StatsEvent, type TfModule, type TfjsCdnUrls, TrackError, type TrackRequest, type TrackResponse, UsageTracker, type UsageTrackerOptions, V4_ONLY_EXERCISE_IDS, type VideoPoseSource, type VisibleHipsInfo, type WarningEvent, configure, createLocalFileStore, createLocalKeyValueStore, createMemoryFileStore, createPoseAdapter, createPoseTracker, createWebFileStore, defaultPoseDetectionCdnUrl, defaultTfjsCdnUrls, drawSkeleton, featureNotSupportedMessage, fetchSkeletonDefinition, findExerciseByIdOrAlias, freeBlockedFeatures, initWebGlBackend, isPaidPlan, isProductionSquatId, mapVideoKeypointsToDisplay, mountDomShell, normalizeEngineChannel, normalizePoseSource, openCameraStream, requiresEngineV4, resolveExerciseName, resolveFeatures, resolveMovementEngine, resolvePoseDetection, resolvePoseModel, resolveTf, shouldShowWatermark, stopMediaStream, toClassicNativeMessage };
|