@pose-tracker/pose-estimation-web 0.1.0 → 0.3.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/README.md CHANGED
@@ -19,13 +19,32 @@ import { createPoseTracker } from '@pose-tracker/pose-estimation-web';
19
19
 
20
20
  const pt = createPoseTracker({ model: 'movenet' });
21
21
  pt.mount('#root');
22
- await pt.start();
22
+ await pt.start(); // default source = camera (webcam)
23
23
  pt.on('keypoints', (e) => console.log(e.keypoints));
24
24
 
25
25
  // BlazePose (peer or CDN window.poseDetection / auto-inject):
26
26
  await pt.setModel('blazepose');
27
+
28
+ // Uploaded video / still image:
29
+ await pt.setSource({ type: 'video', src: videoFile }); // File | Blob | URL | HTMLVideoElement
30
+ await pt.start();
31
+ await pt.setSource({ type: 'image', src: imageFile });
32
+ await pt.start(); // single-shot keypoints
33
+ await pt.analyze(); // re-run on the same image
27
34
  ```
28
35
 
36
+ ## Input sources
37
+
38
+ | `PoseSource` | Behavior |
39
+ |---|---|
40
+ | `{ type: 'camera', facingMode? }` | Live `getUserMedia` (default) |
41
+ | `{ type: 'video', src }` | File / blob URL / `<video>` — stream while playing |
42
+ | `{ type: 'image', src }` | File / blob URL / `<img>` / ImageBitmap — one shot (+ `analyze()`) |
43
+
44
+ Full tables (RN parity, CORS, React): monorepo
45
+ [`docs/MEDIA_SOURCES.md`](../../docs/MEDIA_SOURCES.md) · public
46
+ https://docs.posetracker.com/media-sources
47
+
29
48
  ## Script tag (CDN)
30
49
 
31
50
  The IIFE build exposes a **`PoseTracker`** global (`PoseTracker.createPoseTracker`, …).
@@ -42,7 +61,7 @@ The IIFE build exposes a **`PoseTracker`** global (`PoseTracker.createPoseTracke
42
61
  <!-- 1) TensorFlow.js (peer — required before PoseTracker) -->
43
62
  <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@4.22.0/dist/tf.min.js"></script>
44
63
  <!-- 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>
64
+ <script src="https://cdn.jsdelivr.net/npm/@pose-tracker/pose-estimation-web@0.3.0/dist/pose-tracker.global.js"></script>
46
65
  </head>
47
66
  <body>
48
67
  <div id="root" style="width: 100%; height: 100vh; background: #111"></div>
@@ -50,9 +69,11 @@ The IIFE build exposes a **`PoseTracker`** global (`PoseTracker.createPoseTracke
50
69
  const pt = PoseTracker.createPoseTracker({
51
70
  model: 'movenet',
52
71
  drawSkeleton: true,
72
+ // source defaults to camera; also: { type:'video'|'image', src }
53
73
  });
54
74
  pt.mount('#root');
55
- pt.start().catch(console.error);
75
+ pt.start().catch(console.error); // webcam
76
+ // pt.setSource({ type: 'image', src: file }).then(() => pt.start());
56
77
  pt.on('keypoints', (e) => console.log(e.keypoints.length));
57
78
  </script>
58
79
  </body>
@@ -62,7 +83,7 @@ The IIFE build exposes a **`PoseTracker`** global (`PoseTracker.createPoseTracke
62
83
  Equivalent unpkg URL:
63
84
 
64
85
  ```text
65
- https://unpkg.com/@pose-tracker/pose-estimation-web@0.1.0/dist/pose-tracker.global.js
86
+ https://unpkg.com/@pose-tracker/pose-estimation-web@0.3.0/dist/pose-tracker.global.js
66
87
  ```
67
88
 
68
89
  Omitting `/dist/...` also works — `package.json` `jsdelivr` / `unpkg` fields point at the IIFE.