@pose-tracker/pose-estimation-web-react 0.3.4 → 0.3.6
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 +25 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -0
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -29,3 +29,28 @@ export function App() {
|
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
|
+
|
|
33
|
+
## External frames (your camera, our data)
|
|
34
|
+
|
|
35
|
+
Full guide: https://docs.posetracker.com/external-frames
|
|
36
|
+
|
|
37
|
+
Optional. Skip `<PoseCamera />` and push your own frames. The SDK draws
|
|
38
|
+
nothing and returns the same data as the camera flow (keypoints,
|
|
39
|
+
posture/placement, counter, form score). See the
|
|
40
|
+
[`pose-estimation-web` README](../pose-estimation-web/README.md#external-frames-your-camera-our-data)
|
|
41
|
+
for the rules: one frame in flight, small frames, no mixing with the camera.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
const { warmupExternal, startExercise, processFrame } = usePoseTracker({
|
|
45
|
+
onCounter: (e) => setReps(e.count),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
await warmupExternal();
|
|
49
|
+
startExercise('squat');
|
|
50
|
+
const { dropped, pose, events } = await processFrame({
|
|
51
|
+
image: bitmap,
|
|
52
|
+
width: bitmap.width,
|
|
53
|
+
height: bitmap.height,
|
|
54
|
+
timestampMs: performance.now(),
|
|
55
|
+
});
|
|
56
|
+
```
|
package/dist/index.cjs
CHANGED
|
@@ -88,6 +88,11 @@ function PoseTrackerProvider({
|
|
|
88
88
|
[client]
|
|
89
89
|
);
|
|
90
90
|
const analyze = react.useCallback(() => client.analyze(), [client]);
|
|
91
|
+
const warmupExternal = react.useCallback(() => client.warmupExternal(), [client]);
|
|
92
|
+
const processFrame = react.useCallback(
|
|
93
|
+
(...args) => client.processFrame(...args),
|
|
94
|
+
[client]
|
|
95
|
+
);
|
|
91
96
|
const getSource = react.useCallback(() => client.getSource(), [client]);
|
|
92
97
|
const getAvailableExercises = react.useCallback(() => client.getAvailableExercises(), [client]);
|
|
93
98
|
const getAvailableCustomExercises = react.useCallback(
|
|
@@ -121,6 +126,8 @@ function PoseTrackerProvider({
|
|
|
121
126
|
setModel,
|
|
122
127
|
setSource,
|
|
123
128
|
analyze,
|
|
129
|
+
warmupExternal,
|
|
130
|
+
processFrame,
|
|
124
131
|
getSource,
|
|
125
132
|
getAvailableExercises,
|
|
126
133
|
getAvailableCustomExercises,
|
|
@@ -145,6 +152,8 @@ function PoseTrackerProvider({
|
|
|
145
152
|
setModel,
|
|
146
153
|
setSource,
|
|
147
154
|
analyze,
|
|
155
|
+
warmupExternal,
|
|
156
|
+
processFrame,
|
|
148
157
|
getSource,
|
|
149
158
|
getAvailableExercises,
|
|
150
159
|
getAvailableCustomExercises,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PoseTrackerClient, PoseTrackerStatus, PoseTrackerMode, ErrorEvent, SdkManifest, ExerciseConfig, PreloadOptions, StartExerciseOptions, PoseTrackerClientOptions, PoseTrackerEventListener, ClassicNativeMessage, PoseSource, PoseSourceType, SkeletonDefinition, PoseTrackerCallbacks } from '@pose-tracker/pose-estimation-web';
|
|
2
|
-
export { COCO_KEYPOINT_NAMES, ColdStartMode, CounterEvent, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, EngineChannel, ErrorEvent, ExerciseConfig, InitializationEvent, Keypoint, KeypointsEvent, Pose, PoseModelAlias, PoseSource, PoseSourceType, PoseTracker, PoseTrackerCallbacks, PoseTrackerClient, PoseTrackerClientOptions, PoseTrackerOptions, PostureEvent, PreloadOptions, SDK_NAME, SDK_VERSION, SdkManifest, StartExerciseOptions, V4_ONLY_EXERCISE_IDS, createPoseTracker, normalizeEngineChannel, normalizePoseSource, requiresEngineV4, resolvePoseModel, shouldShowWatermark } from '@pose-tracker/pose-estimation-web';
|
|
2
|
+
export { COCO_KEYPOINT_NAMES, ColdStartMode, CounterEvent, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, EngineChannel, ErrorEvent, ExerciseConfig, ExternalFrame, ExternalFrameResult, InitializationEvent, Keypoint, KeypointsEvent, Pose, PoseModelAlias, PoseSource, PoseSourceType, PoseTracker, PoseTrackerCallbacks, PoseTrackerClient, PoseTrackerClientOptions, PoseTrackerOptions, PostureEvent, PreloadOptions, SDK_NAME, SDK_VERSION, SdkManifest, StartExerciseOptions, V4_ONLY_EXERCISE_IDS, createPoseTracker, normalizeEngineChannel, normalizePoseSource, requiresEngineV4, resolvePoseModel, shouldShowWatermark } from '@pose-tracker/pose-estimation-web';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -22,6 +22,10 @@ interface PoseTrackerContextValue {
|
|
|
22
22
|
setModel: (model?: PoseTrackerClientOptions['model'], modelUrl?: string) => Promise<void>;
|
|
23
23
|
setSource: PoseTrackerClient['setSource'];
|
|
24
24
|
analyze: PoseTrackerClient['analyze'];
|
|
25
|
+
/** Opt-in: warm the model for frames from your own camera (no PoseCamera needed). */
|
|
26
|
+
warmupExternal: PoseTrackerClient['warmupExternal'];
|
|
27
|
+
/** Infer one frame from your own camera; resolves `{ dropped, pose, events }`. */
|
|
28
|
+
processFrame: PoseTrackerClient['processFrame'];
|
|
25
29
|
getSource: PoseTrackerClient['getSource'];
|
|
26
30
|
getAvailableExercises: () => ExerciseConfig[];
|
|
27
31
|
getAvailableCustomExercises: () => ReturnType<PoseTrackerClient['getAvailableCustomExercises']>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PoseTrackerClient, PoseTrackerStatus, PoseTrackerMode, ErrorEvent, SdkManifest, ExerciseConfig, PreloadOptions, StartExerciseOptions, PoseTrackerClientOptions, PoseTrackerEventListener, ClassicNativeMessage, PoseSource, PoseSourceType, SkeletonDefinition, PoseTrackerCallbacks } from '@pose-tracker/pose-estimation-web';
|
|
2
|
-
export { COCO_KEYPOINT_NAMES, ColdStartMode, CounterEvent, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, EngineChannel, ErrorEvent, ExerciseConfig, InitializationEvent, Keypoint, KeypointsEvent, Pose, PoseModelAlias, PoseSource, PoseSourceType, PoseTracker, PoseTrackerCallbacks, PoseTrackerClient, PoseTrackerClientOptions, PoseTrackerOptions, PostureEvent, PreloadOptions, SDK_NAME, SDK_VERSION, SdkManifest, StartExerciseOptions, V4_ONLY_EXERCISE_IDS, createPoseTracker, normalizeEngineChannel, normalizePoseSource, requiresEngineV4, resolvePoseModel, shouldShowWatermark } from '@pose-tracker/pose-estimation-web';
|
|
2
|
+
export { COCO_KEYPOINT_NAMES, ColdStartMode, CounterEvent, DEFAULT_LOADING_TEXT, DEFAULT_MOVENET_LIGHTNING_URL, EngineChannel, ErrorEvent, ExerciseConfig, ExternalFrame, ExternalFrameResult, InitializationEvent, Keypoint, KeypointsEvent, Pose, PoseModelAlias, PoseSource, PoseSourceType, PoseTracker, PoseTrackerCallbacks, PoseTrackerClient, PoseTrackerClientOptions, PoseTrackerOptions, PostureEvent, PreloadOptions, SDK_NAME, SDK_VERSION, SdkManifest, StartExerciseOptions, V4_ONLY_EXERCISE_IDS, createPoseTracker, normalizeEngineChannel, normalizePoseSource, requiresEngineV4, resolvePoseModel, shouldShowWatermark } from '@pose-tracker/pose-estimation-web';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -22,6 +22,10 @@ interface PoseTrackerContextValue {
|
|
|
22
22
|
setModel: (model?: PoseTrackerClientOptions['model'], modelUrl?: string) => Promise<void>;
|
|
23
23
|
setSource: PoseTrackerClient['setSource'];
|
|
24
24
|
analyze: PoseTrackerClient['analyze'];
|
|
25
|
+
/** Opt-in: warm the model for frames from your own camera (no PoseCamera needed). */
|
|
26
|
+
warmupExternal: PoseTrackerClient['warmupExternal'];
|
|
27
|
+
/** Infer one frame from your own camera; resolves `{ dropped, pose, events }`. */
|
|
28
|
+
processFrame: PoseTrackerClient['processFrame'];
|
|
25
29
|
getSource: PoseTrackerClient['getSource'];
|
|
26
30
|
getAvailableExercises: () => ExerciseConfig[];
|
|
27
31
|
getAvailableCustomExercises: () => ReturnType<PoseTrackerClient['getAvailableCustomExercises']>;
|
package/dist/index.js
CHANGED
|
@@ -87,6 +87,11 @@ function PoseTrackerProvider({
|
|
|
87
87
|
[client]
|
|
88
88
|
);
|
|
89
89
|
const analyze = useCallback(() => client.analyze(), [client]);
|
|
90
|
+
const warmupExternal = useCallback(() => client.warmupExternal(), [client]);
|
|
91
|
+
const processFrame = useCallback(
|
|
92
|
+
(...args) => client.processFrame(...args),
|
|
93
|
+
[client]
|
|
94
|
+
);
|
|
90
95
|
const getSource = useCallback(() => client.getSource(), [client]);
|
|
91
96
|
const getAvailableExercises = useCallback(() => client.getAvailableExercises(), [client]);
|
|
92
97
|
const getAvailableCustomExercises = useCallback(
|
|
@@ -120,6 +125,8 @@ function PoseTrackerProvider({
|
|
|
120
125
|
setModel,
|
|
121
126
|
setSource,
|
|
122
127
|
analyze,
|
|
128
|
+
warmupExternal,
|
|
129
|
+
processFrame,
|
|
123
130
|
getSource,
|
|
124
131
|
getAvailableExercises,
|
|
125
132
|
getAvailableCustomExercises,
|
|
@@ -144,6 +151,8 @@ function PoseTrackerProvider({
|
|
|
144
151
|
setModel,
|
|
145
152
|
setSource,
|
|
146
153
|
analyze,
|
|
154
|
+
warmupExternal,
|
|
155
|
+
processFrame,
|
|
147
156
|
getSource,
|
|
148
157
|
getAvailableExercises,
|
|
149
158
|
getAvailableCustomExercises,
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pose-tracker/pose-estimation-web-react",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "0.3.6",
|
|
5
4
|
"description": "PoseTracker React (web) pose estimation — thin wrapper over @pose-tracker/pose-estimation-web. Browser camera + canvas, not React Native.",
|
|
6
5
|
"type": "module",
|
|
7
6
|
"main": "./dist/index.cjs",
|
|
@@ -45,7 +44,7 @@
|
|
|
45
44
|
"url": "https://www.posetracker.com"
|
|
46
45
|
},
|
|
47
46
|
"license": "SEE LICENSE IN LICENSE",
|
|
48
|
-
"homepage": "https://
|
|
47
|
+
"homepage": "https://github.com/Movelytics/pose-estimation-web-react#readme",
|
|
49
48
|
"repository": {
|
|
50
49
|
"type": "git",
|
|
51
50
|
"url": "git+https://github.com/Movelytics/pose-estimation-web-react.git"
|
|
@@ -54,12 +53,12 @@
|
|
|
54
53
|
"access": "public"
|
|
55
54
|
},
|
|
56
55
|
"dependencies": {
|
|
57
|
-
"@pose-tracker/pose-estimation-web": "0.3.
|
|
56
|
+
"@pose-tracker/pose-estimation-web": "0.3.6"
|
|
58
57
|
},
|
|
59
58
|
"peerDependencies": {
|
|
59
|
+
"@tensorflow/tfjs": "^4.22.0",
|
|
60
60
|
"react": ">=18.0.0",
|
|
61
|
-
"react-dom": ">=18.0.0"
|
|
62
|
-
"@tensorflow/tfjs": "^4.22.0"
|
|
61
|
+
"react-dom": ">=18.0.0"
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
64
|
"@types/react": "^18.2.0",
|
|
@@ -68,5 +67,8 @@
|
|
|
68
67
|
"react-dom": "^18.2.0",
|
|
69
68
|
"tsup": "^8.4.0",
|
|
70
69
|
"typescript": "^5.4.0"
|
|
70
|
+
},
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/Movelytics/pose-estimation-web-react/issues"
|
|
71
73
|
}
|
|
72
74
|
}
|