@pose-tracker/pose-estimation-web 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,41 @@
1
+ PoseTracker Web SDK
2
+ Copyright (c) 2024–2026 Movelytics SAS. All rights reserved.
3
+
4
+ PROPRIETARY SOFTWARE LICENSE
5
+
6
+ This package published under the @pose-tracker scope (the "Software") is
7
+ proprietary to Movelytics SAS ("Licensor").
8
+
9
+ 1. Grant of use
10
+ Subject to a valid PoseTracker account and applicable product terms
11
+ (including free-tier limits and paid plans), Licensor grants you a
12
+ non-exclusive, non-transferable, revocable license to install and use the
13
+ Software in your applications to access PoseTracker services and browser
14
+ pose estimation features as documented.
15
+
16
+ 2. Restrictions
17
+ Except as expressly permitted in writing by Licensor, you may not:
18
+ - sell, sublicense, or redistribute the Software as a competing SDK or
19
+ standalone pose-estimation product;
20
+ - remove or obscure proprietary notices, branding, or watermarks required
21
+ by your plan;
22
+ - reverse engineer the remote movement engine or proprietary pipeline
23
+ beyond what applicable law permits;
24
+ - use the Software in violation of PoseTracker Terms of Service or
25
+ applicable law.
26
+
27
+ 3. Third-party components
28
+ The Software uses third-party components (including TensorFlow.js and the
29
+ MoveNet model) under their own licenses. See THIRD_PARTY_NOTICES.md.
30
+ Those licenses are not overridden by this LICENSE.
31
+
32
+ 4. No warranty
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
36
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
37
+ LIABILITY ARISING FROM THE SOFTWARE OR ITS USE.
38
+
39
+ 5. Commercial terms
40
+ Paid plans, API keys, usage limits, and support are governed by your
41
+ PoseTracker agreement and https://www.posetracker.com terms.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # `@pose-tracker/pose-estimation-web`
2
+
3
+ Vanilla browser pose estimation (MoveNet / BlazePose / custom `modelUrl`) +
4
+ remote exercise engine after `configure(apiToken)`.
5
+
6
+ Default model:
7
+ `https://app.posetracker.com/scripts/tmp_model_to_remove.json`
8
+
9
+ ## Install (npm)
10
+
11
+ ```bash
12
+ npm install @pose-tracker/pose-estimation-web @tensorflow/tfjs
13
+ # Optional — BlazePose in bundlers (React / Vite). Vanilla IIFE can use CDN.
14
+ npm install @tensorflow-models/pose-detection
15
+ ```
16
+
17
+ ```ts
18
+ import { createPoseTracker } from '@pose-tracker/pose-estimation-web';
19
+
20
+ const pt = createPoseTracker({ model: 'movenet' });
21
+ pt.mount('#root');
22
+ await pt.start();
23
+ pt.on('keypoints', (e) => console.log(e.keypoints));
24
+
25
+ // BlazePose (peer or CDN window.poseDetection / auto-inject):
26
+ await pt.setModel('blazepose');
27
+ ```
28
+
29
+ ## Script tag (CDN)
30
+
31
+ The IIFE build exposes a **`PoseTracker`** global (`PoseTracker.createPoseTracker`, …).
32
+
33
+ **Load TensorFlow.js first**, then the SDK. Order matters.
34
+
35
+ ```html
36
+ <!DOCTYPE html>
37
+ <html lang="en">
38
+ <head>
39
+ <meta charset="UTF-8" />
40
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
41
+ <title>PoseTracker</title>
42
+ <!-- 1) TensorFlow.js (peer — required before PoseTracker) -->
43
+ <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@4.22.0/dist/tf.min.js"></script>
44
+ <!-- 2) PoseTracker IIFE (jsDelivr / unpkg both work) -->
45
+ <script src="https://cdn.jsdelivr.net/npm/@pose-tracker/pose-estimation-web@0.1.0/dist/pose-tracker.global.js"></script>
46
+ </head>
47
+ <body>
48
+ <div id="root" style="width: 100%; height: 100vh; background: #111"></div>
49
+ <script>
50
+ const pt = PoseTracker.createPoseTracker({
51
+ model: 'movenet',
52
+ drawSkeleton: true,
53
+ });
54
+ pt.mount('#root');
55
+ pt.start().catch(console.error);
56
+ pt.on('keypoints', (e) => console.log(e.keypoints.length));
57
+ </script>
58
+ </body>
59
+ </html>
60
+ ```
61
+
62
+ Equivalent unpkg URL:
63
+
64
+ ```text
65
+ https://unpkg.com/@pose-tracker/pose-estimation-web@0.1.0/dist/pose-tracker.global.js
66
+ ```
67
+
68
+ Omitting `/dist/...` also works — `package.json` `jsdelivr` / `unpkg` fields point at the IIFE.
69
+
70
+ ### Optional BlazePose (CDN)
71
+
72
+ Preload pose-detection after TF.js (or omit — the SDK can inject the same CDN URL):
73
+
74
+ ```html
75
+ <script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/pose-detection@2.1.3/dist/pose-detection.min.js"></script>
76
+ ```
77
+
78
+ ### Global API (IIFE)
79
+
80
+ | Global | Notes |
81
+ |--------|--------|
82
+ | `PoseTracker.createPoseTracker(options?)` | Main factory |
83
+ | `PoseTracker.PoseCamera` / mount helpers | Camera helper |
84
+ | `PoseTracker.configure` | Standalone configure helper |
85
+ | `PoseTracker.DEFAULT_MOVENET_LIGHTNING_URL` | Default model URL |
86
+ | `PoseTracker.SDK_VERSION` / `SDK_NAME` | Package identity |
87
+
88
+ BlazePose maps to the same COCO-17 `keypoints` event shape as MoveNet (extra
89
+ face/hand/foot landmarks dropped). It is heavier than MoveNet Lightning.
90
+
91
+ See monorepo root README for exercises + examples.
@@ -0,0 +1,17 @@
1
+ # Third-party notices
2
+
3
+ ## TensorFlow.js
4
+
5
+ - Copyright: Google LLC and TensorFlow authors
6
+ - License: Apache License 2.0 — https://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ ## MoveNet SinglePose Lightning (model weights)
9
+
10
+ - Copyright: Google LLC
11
+ - License: Apache License 2.0 — https://www.apache.org/licenses/LICENSE-2.0
12
+ - Hub: https://tfhub.dev/google/movenet/singlepose/lightning/4
13
+
14
+ ## @tensorflow-models/pose-detection (optional BlazePose)
15
+
16
+ - Copyright: Google LLC
17
+ - License: Apache License 2.0 — https://www.apache.org/licenses/LICENSE-2.0