react-native-nitro-pose-exercises 1.0.8 → 1.1.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/NitroPoseExercises.podspec +2 -1
- package/README.md +137 -92
- package/android/build.gradle +9 -10
- package/android/src/main/java/com/margelo/nitro/nitroposeexercises/NitroPoseExercises.kt +148 -125
- package/ios/NitroPoseExercises.swift +113 -88
- package/lib/module/config/bicep-curl.js +61 -0
- package/lib/module/config/bicep-curl.js.map +1 -0
- package/lib/module/config/chair-pose.js +64 -0
- package/lib/module/config/chair-pose.js.map +1 -0
- package/lib/module/config/cobra-pose.js +57 -0
- package/lib/module/config/cobra-pose.js.map +1 -0
- package/lib/module/config/downward-dog.js +65 -0
- package/lib/module/config/downward-dog.js.map +1 -0
- package/lib/module/config/lunge.js +62 -0
- package/lib/module/config/lunge.js.map +1 -0
- package/lib/module/config/plank.js +57 -0
- package/lib/module/config/plank.js.map +1 -0
- package/lib/module/config/shoulder-press.js +62 -0
- package/lib/module/config/shoulder-press.js.map +1 -0
- package/lib/module/config/situp.js +48 -0
- package/lib/module/config/situp.js.map +1 -0
- package/lib/module/config/squat.js +69 -0
- package/lib/module/config/squat.js.map +1 -0
- package/lib/module/config/tree-pose.js +57 -0
- package/lib/module/config/tree-pose.js.map +1 -0
- package/lib/module/config/tricep-dip.js +55 -0
- package/lib/module/config/tricep-dip.js.map +1 -0
- package/lib/module/config/wall-sit.js +57 -0
- package/lib/module/config/wall-sit.js.map +1 -0
- package/lib/module/config/warrior-i.js +79 -0
- package/lib/module/config/warrior-i.js.map +1 -0
- package/lib/module/config/warrior-ii.js +86 -0
- package/lib/module/config/warrior-ii.js.map +1 -0
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/config/bicep-curl.d.ts +3 -0
- package/lib/typescript/src/config/bicep-curl.d.ts.map +1 -0
- package/lib/typescript/src/config/chair-pose.d.ts +3 -0
- package/lib/typescript/src/config/chair-pose.d.ts.map +1 -0
- package/lib/typescript/src/config/cobra-pose.d.ts +3 -0
- package/lib/typescript/src/config/cobra-pose.d.ts.map +1 -0
- package/lib/typescript/src/config/downward-dog.d.ts +3 -0
- package/lib/typescript/src/config/downward-dog.d.ts.map +1 -0
- package/lib/typescript/src/config/lunge.d.ts +3 -0
- package/lib/typescript/src/config/lunge.d.ts.map +1 -0
- package/lib/typescript/src/config/plank.d.ts +3 -0
- package/lib/typescript/src/config/plank.d.ts.map +1 -0
- package/lib/typescript/src/config/shoulder-press.d.ts +3 -0
- package/lib/typescript/src/config/shoulder-press.d.ts.map +1 -0
- package/lib/typescript/src/config/situp.d.ts +3 -0
- package/lib/typescript/src/config/situp.d.ts.map +1 -0
- package/lib/typescript/src/config/squat.d.ts +3 -0
- package/lib/typescript/src/config/squat.d.ts.map +1 -0
- package/lib/typescript/src/config/tree-pose.d.ts +3 -0
- package/lib/typescript/src/config/tree-pose.d.ts.map +1 -0
- package/lib/typescript/src/config/tricep-dip.d.ts +3 -0
- package/lib/typescript/src/config/tricep-dip.d.ts.map +1 -0
- package/lib/typescript/src/config/wall-sit.d.ts +3 -0
- package/lib/typescript/src/config/wall-sit.d.ts.map +1 -0
- package/lib/typescript/src/config/warrior-i.d.ts +3 -0
- package/lib/typescript/src/config/warrior-i.d.ts.map +1 -0
- package/lib/typescript/src/config/warrior-ii.d.ts +3 -0
- package/lib/typescript/src/config/warrior-ii.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +14 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitro.json +8 -1
- package/package.json +10 -10
- package/src/config/bicep-curl.ts +64 -0
- package/src/config/chair-pose.ts +67 -0
- package/src/config/cobra-pose.ts +59 -0
- package/src/config/downward-dog.ts +68 -0
- package/src/config/lunge.ts +65 -0
- package/src/config/plank.ts +59 -0
- package/src/config/shoulder-press.ts +63 -0
- package/src/config/situp.ts +51 -0
- package/src/config/squat.ts +71 -0
- package/src/config/tree-pose.ts +59 -0
- package/src/config/tricep-dip.ts +58 -0
- package/src/config/wall-sit.ts +59 -0
- package/src/config/warrior-i.ts +82 -0
- package/src/config/warrior-ii.ts +88 -0
- package/src/index.tsx +19 -0
|
@@ -19,13 +19,14 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
"cpp/**/*.{hpp,cpp}",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
|
+
s.frameworks = ["AVFoundation", "Vision"]
|
|
23
|
+
|
|
22
24
|
s.dependency 'React-jsi'
|
|
23
25
|
s.dependency 'React-callinvoker'
|
|
24
26
|
|
|
25
27
|
load 'nitrogen/generated/ios/NitroPoseExercises+autolinking.rb'
|
|
26
28
|
add_nitrogen_files(s)
|
|
27
29
|
|
|
28
|
-
s.dependency 'MediaPipeTasksVision', '~> 0.10.0'
|
|
29
30
|
s.dependency "VisionCamera"
|
|
30
31
|
|
|
31
32
|
install_modules_dependencies(s)
|
package/README.md
CHANGED
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
|
|
7
7
|
# react-native-nitro-pose-exercises
|
|
8
8
|
|
|
9
|
-
A **React Native Nitro Module** for real-time, on-device exercise tracking using pose estimation.
|
|
9
|
+
A **React Native Nitro Module** for real-time, on-device exercise tracking using pose estimation. Uses **OS-native pose detection** — Apple Vision on iOS and Google ML Kit on Android — with **VisionCamera v5**.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
* 🏋️ **Rep Counting** — Automatic rep detection with configurable state machines
|
|
12
|
+
* 🧘 **Hold Tracking** — Duration and stability tracking for planks, yoga poses, and isometric holds
|
|
13
|
+
* 📐 **Form Validation** — Real-time form feedback with configurable angle-based rules
|
|
14
|
+
* 💀 **Skeleton Overlay** — Optional Skia-powered skeleton rendering over the camera feed
|
|
15
|
+
* ⚡ **Fully Native** — OS-level pose detection via Nitro Modules, zero JS bridge overhead
|
|
16
|
+
* 📦 **Zero Model Bundling** — No ML model files to download or ship with your app
|
|
16
17
|
|
|
17
18
|
---
|
|
18
19
|
|
|
19
20
|
> [!IMPORTANT]
|
|
20
21
|
>
|
|
21
|
-
>
|
|
22
|
-
>
|
|
23
|
-
>
|
|
22
|
+
> * Requires React Native **0.76+** with Nitro Modules and VisionCamera **v5**.
|
|
23
|
+
> * Must be tested on a **physical device** — camera + ML inference don't work on simulators.
|
|
24
|
+
> * iOS requires **iOS 14+** (Vision body pose API). Android requires **API 23+** (ML Kit).
|
|
24
25
|
|
|
25
26
|
---
|
|
26
27
|
|
|
@@ -44,9 +45,10 @@ cd ios && pod install
|
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
> [!NOTE]
|
|
47
|
-
> This package uses **
|
|
48
|
-
> iOS uses `
|
|
49
|
-
> Android uses `com.google.
|
|
48
|
+
> This package uses **OS-native pose detection** on both platforms.
|
|
49
|
+
> iOS uses Apple's **Vision framework** (`VNDetectHumanBodyPoseRequest`) — built into iOS, no extra dependencies.
|
|
50
|
+
> Android uses **Google ML Kit Pose Detection** (`com.google.mlkit:pose-detection:18.0.0-beta5`) — model auto-managed via Play Services.
|
|
51
|
+
> **No model files to bundle, no extra downloads, no color format conversions.**
|
|
50
52
|
|
|
51
53
|
---
|
|
52
54
|
|
|
@@ -71,30 +73,25 @@ cd ios && pod install
|
|
|
71
73
|
|
|
72
74
|
## 🧠 Overview
|
|
73
75
|
|
|
74
|
-
| Feature
|
|
75
|
-
|
|
|
76
|
-
| **Rep-Based Exercises**
|
|
76
|
+
| Feature | Description |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| **Rep-Based Exercises** | Cyclic state machine (UP → DOWN → UP = 1 rep). Push-ups, squats, curls. |
|
|
77
79
|
| **Hold-Based Exercises** | Single target pose with duration tracking. Planks, wall sits, yoga poses. |
|
|
78
|
-
| **Flow-Based Exercises** | Ordered sequence of poses. Sun salutation, yoga flows.
|
|
79
|
-
| **Form Feedback**
|
|
80
|
-
| **Skeleton Overlay**
|
|
81
|
-
| **Bilateral Tracking**
|
|
80
|
+
| **Flow-Based Exercises** | Ordered sequence of poses. Sun salutation, yoga flows. *(coming soon)* |
|
|
81
|
+
| **Form Feedback** | Angle-based rules with throttled real-time callbacks. |
|
|
82
|
+
| **Skeleton Overlay** | Body skeleton drawn over camera via Skia (19 joints iOS, 33 joints Android). |
|
|
83
|
+
| **Bilateral Tracking** | Left and right side angles tracked independently. |
|
|
82
84
|
|
|
83
85
|
---
|
|
84
86
|
|
|
85
87
|
## 🔧 Setup
|
|
86
88
|
|
|
87
|
-
### Model File
|
|
89
|
+
### No Model File Needed
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
Unlike MediaPipe-based solutions, this library uses OS-native APIs. There is **no model file to download or bundle**.
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**iOS:** Drag `pose_landmarker_lite.task` into your Xcode project (Copy items if needed, add to app target).
|
|
96
|
-
|
|
97
|
-
**Android:** Place at `android/app/src/main/assets/pose_landmarker_lite.task`
|
|
93
|
+
* **iOS:** Apple Vision is a system framework — it's already on every iPhone running iOS 14+.
|
|
94
|
+
* **Android:** ML Kit manages its own model via Google Play Services — it downloads and updates automatically.
|
|
98
95
|
|
|
99
96
|
### Permissions
|
|
100
97
|
|
|
@@ -125,6 +122,26 @@ module.exports = {
|
|
|
125
122
|
};
|
|
126
123
|
```
|
|
127
124
|
|
|
125
|
+
### Podspec (for library authors)
|
|
126
|
+
|
|
127
|
+
The iOS podspec needs the Vision and AVFoundation system frameworks:
|
|
128
|
+
|
|
129
|
+
```ruby
|
|
130
|
+
s.frameworks = 'Vision', 'AVFoundation'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
No CocoaPods dependencies required — Vision is built into iOS.
|
|
134
|
+
|
|
135
|
+
### Android Gradle (for library authors)
|
|
136
|
+
|
|
137
|
+
Add ML Kit Pose Detection to `android/build.gradle`:
|
|
138
|
+
|
|
139
|
+
```groovy
|
|
140
|
+
dependencies {
|
|
141
|
+
implementation 'com.google.mlkit:pose-detection:18.0.0-beta5'
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
128
145
|
---
|
|
129
146
|
|
|
130
147
|
## ⚙️ Usage
|
|
@@ -159,10 +176,10 @@ export default function App() {
|
|
|
159
176
|
if (!hasPermission) requestPermission();
|
|
160
177
|
}, [hasPermission]);
|
|
161
178
|
|
|
162
|
-
// Initialize pose engine
|
|
179
|
+
// Initialize pose engine — modelPath is ignored (OS-native, no model file)
|
|
163
180
|
useEffect(() => {
|
|
164
181
|
async function init() {
|
|
165
|
-
await nitroPoseExercises.initialize('
|
|
182
|
+
await nitroPoseExercises.initialize('');
|
|
166
183
|
nitroPoseExercises.loadExercise(PUSHUP_CONFIG);
|
|
167
184
|
|
|
168
185
|
nitroPoseExercises.onRepComplete = (data: RepData) => {
|
|
@@ -310,7 +327,7 @@ const SKELETON_CONNECTIONS: [number, number][] = [
|
|
|
310
327
|
### Lifecycle
|
|
311
328
|
|
|
312
329
|
```ts
|
|
313
|
-
// Initialize
|
|
330
|
+
// Initialize the pose engine (modelPath is ignored — OS-native, no model file needed)
|
|
314
331
|
initialize(modelPath: string): Promise<void>
|
|
315
332
|
|
|
316
333
|
// Clean up resources
|
|
@@ -346,7 +363,7 @@ processFrame(frame: Frame): void
|
|
|
346
363
|
readonly status: SessionStatus // 'idle' | 'countdown' | 'active' | 'paused' | 'completed'
|
|
347
364
|
readonly currentPhase: ExercisePhase // 'up' | 'down' | 'hold' | 'transition' | 'unknown'
|
|
348
365
|
readonly repCount: number
|
|
349
|
-
readonly landmarks: Landmark[] //
|
|
366
|
+
readonly landmarks: Landmark[] // Body landmarks (mapped to MediaPipe indices)
|
|
350
367
|
```
|
|
351
368
|
|
|
352
369
|
### Callbacks
|
|
@@ -380,9 +397,9 @@ onSessionComplete: ((result: SessionResult) => void) | undefined
|
|
|
380
397
|
|
|
381
398
|
```ts
|
|
382
399
|
{
|
|
383
|
-
ruleName: string
|
|
384
|
-
message: string
|
|
385
|
-
severity: FormSeverity
|
|
400
|
+
ruleName: string // e.g. 'hipSag'
|
|
401
|
+
message: string // e.g. 'Keep your hips up'
|
|
402
|
+
severity: FormSeverity // 'info' | 'warning' | 'error'
|
|
386
403
|
}
|
|
387
404
|
```
|
|
388
405
|
|
|
@@ -403,62 +420,88 @@ onSessionComplete: ((result: SessionResult) => void) | undefined
|
|
|
403
420
|
|
|
404
421
|
## 🏋️ Built-In Exercise Configs
|
|
405
422
|
|
|
406
|
-
###
|
|
423
|
+
### Rep-Based
|
|
407
424
|
|
|
408
|
-
|
|
|
409
|
-
|
|
|
410
|
-
|
|
|
411
|
-
|
|
|
412
|
-
|
|
|
413
|
-
|
|
|
414
|
-
|
|
|
415
|
-
|
|
|
425
|
+
| Config | Exercise | Primary Angle | Form Rules |
|
|
426
|
+
| --- | --- | --- | --- |
|
|
427
|
+
| `PUSHUP_CONFIG` | Push-Up | Elbow (140°–180° up, 30°–110° down) | Hip sag, hip pike |
|
|
428
|
+
| `SQUAT_CONFIG` | Squat | Knee (155°–180° up, 50°–105° down) | Knees caving, leaning forward |
|
|
429
|
+
| `BICEP_CURL_CONFIG` | Bicep Curl | Elbow (150°–180° down, 25°–70° up) | Elbow flare, swinging |
|
|
430
|
+
| `SHOULDER_PRESS_CONFIG` | Shoulder Press | Elbow (155°–180° up, 60°–100° down) | Back arch |
|
|
431
|
+
| `LUNGE_CONFIG` | Lunge | Front knee (155°–180° up, 70°–110° down) | Knee over toe, torso lean |
|
|
432
|
+
| `SITUP_CONFIG` | Sit-Up | Hip (130°–180° down, 40°–90° up) | Neck strain |
|
|
433
|
+
| `TRICEP_DIP_CONFIG` | Tricep Dip | Elbow (150°–180° up, 60°–100° down) | Going too deep |
|
|
434
|
+
|
|
435
|
+
### Hold-Based
|
|
436
|
+
|
|
437
|
+
| Config | Exercise | Hold Angle | Duration | Form Rules |
|
|
438
|
+
| --- | --- | --- | --- | --- |
|
|
439
|
+
| `PLANK_CONFIG` | Plank | Hip 155°–180° | 60s | Hip sag, hip pike |
|
|
440
|
+
| `WALL_SIT_CONFIG` | Wall Sit | Knee 80°–110° | 45s | Too high, leaning forward |
|
|
441
|
+
|
|
442
|
+
### Yoga Poses
|
|
443
|
+
|
|
444
|
+
| Config | Exercise | Hold Angle | Duration | Form Rules |
|
|
445
|
+
| --- | --- | --- | --- | --- |
|
|
446
|
+
| `TREE_POSE_CONFIG` | Tree Pose (Vrksasana) | Standing leg 165°–180° | 30s | Standing leg bent, leaning torso |
|
|
447
|
+
| `WARRIOR_I_CONFIG` | Warrior I (Virabhadrasana I) | Front knee 80°–110° | 30s | Knee too straight, back leg bent, arms not extended, torso leaning |
|
|
448
|
+
| `WARRIOR_II_CONFIG` | Warrior II (Virabhadrasana II) | Front knee 80°–110° | 30s | Knee too straight, back leg bent, arms drooping |
|
|
449
|
+
| `DOWNWARD_DOG_CONFIG` | Downward Dog (Adho Mukha Svanasana) | Hip 55°–100° | 30s | Arms bent, legs bent, hips too low |
|
|
450
|
+
| `CHAIR_POSE_CONFIG` | Chair Pose (Utkatasana) | Knee 90°–130° | 30s | Knees too straight, leaning forward, arms not up |
|
|
451
|
+
| `COBRA_POSE_CONFIG` | Cobra Pose (Bhujangasana) | Hip extension 120°–170° | 30s | Shoulders tensed, legs bending |
|
|
416
452
|
|
|
417
453
|
### Custom Exercise Config
|
|
418
454
|
|
|
419
455
|
```ts
|
|
420
456
|
import type { ExerciseConfig } from 'react-native-nitro-pose-exercises';
|
|
421
457
|
|
|
422
|
-
const
|
|
423
|
-
name: '
|
|
424
|
-
type: 'rep',
|
|
458
|
+
const MY_EXERCISE: ExerciseConfig = {
|
|
459
|
+
name: 'Custom Exercise',
|
|
460
|
+
type: 'rep', // 'rep' | 'hold'
|
|
425
461
|
angles: [
|
|
426
|
-
{ name: '
|
|
427
|
-
{ name: 'rightKnee', landmarkA: 24, landmarkB: 26, landmarkC: 28 },
|
|
462
|
+
{ name: 'myAngle', landmarkA: 11, landmarkB: 13, landmarkC: 15 },
|
|
428
463
|
],
|
|
429
464
|
phases: [
|
|
430
|
-
{ phase: 'up', angleName: '
|
|
431
|
-
{ phase: 'down', angleName: '
|
|
465
|
+
{ phase: 'up', angleName: 'myAngle', minAngle: 150, maxAngle: 180 },
|
|
466
|
+
{ phase: 'down', angleName: 'myAngle', minAngle: 30, maxAngle: 100 },
|
|
432
467
|
],
|
|
433
468
|
repSequence: ['up', 'down', 'up'],
|
|
434
|
-
formRules: [
|
|
435
|
-
{
|
|
436
|
-
name: 'kneesCaving',
|
|
437
|
-
message: 'Push your knees out over your toes',
|
|
438
|
-
severity: 'warning',
|
|
439
|
-
angleName: 'leftKnee',
|
|
440
|
-
minAngle: 50,
|
|
441
|
-
maxAngle: 180,
|
|
442
|
-
},
|
|
443
|
-
],
|
|
469
|
+
formRules: [],
|
|
444
470
|
holdDurationMs: 0,
|
|
445
471
|
};
|
|
446
472
|
```
|
|
447
473
|
|
|
448
474
|
---
|
|
449
475
|
|
|
450
|
-
## 📐
|
|
476
|
+
## 📐 Landmark Index Reference
|
|
477
|
+
|
|
478
|
+
Landmarks are mapped to MediaPipe-compatible indices on both platforms. iOS Vision provides 19 joints (all exercise-critical joints covered), Android ML Kit provides the full 33.
|
|
451
479
|
|
|
452
|
-
| Index | Landmark
|
|
453
|
-
|
|
|
454
|
-
| 0
|
|
455
|
-
| 11
|
|
456
|
-
| 12
|
|
457
|
-
| 13
|
|
458
|
-
| 14
|
|
459
|
-
| 15
|
|
480
|
+
| Index | Landmark | Index | Landmark |
|
|
481
|
+
| --- | --- | --- | --- |
|
|
482
|
+
| 0 | Nose | 16 | Right wrist |
|
|
483
|
+
| 11 | Left shoulder | 23 | Left hip |
|
|
484
|
+
| 12 | Right shoulder | 24 | Right hip |
|
|
485
|
+
| 13 | Left elbow | 25 | Left knee |
|
|
486
|
+
| 14 | Right elbow | 26 | Right knee |
|
|
487
|
+
| 15 | Left wrist | 27 | Left ankle |
|
|
460
488
|
|
|
461
|
-
|
|
489
|
+
**iOS note:** Vision provides 19 joints. Indices not available from Vision (face details 1-10, hands 17-22, feet 29-32) are filled with `visibility: 0` and skipped by the skeleton overlay.
|
|
490
|
+
|
|
491
|
+
**Android note:** ML Kit provides all 33 landmarks matching MediaPipe indices exactly.
|
|
492
|
+
|
|
493
|
+
---
|
|
494
|
+
|
|
495
|
+
## 🏗️ Architecture — OS-Native vs MediaPipe
|
|
496
|
+
|
|
497
|
+
| | OS-Native (current) | MediaPipe (previous) |
|
|
498
|
+
| --- | --- | --- |
|
|
499
|
+
| **iOS** | Apple Vision framework (built-in) | MediaPipeTasksVision (CocoaPod) |
|
|
500
|
+
| **Android** | Google ML Kit (Play Services) | com.google.mediapipe:tasks-vision |
|
|
501
|
+
| **Model file** | None needed | ~3 MB bundled `.task` file |
|
|
502
|
+
| **Color conversion** | None — takes CVPixelBuffer/ImageProxy directly | BGRA required (iOS), NV21→RGB (Android) |
|
|
503
|
+
| **App size impact** | ~200 KB (Nitro module code only) | ~11-15 MB (SDK + model) |
|
|
504
|
+
| **Updates** | OS/Play Services updates | Manual model file replacement |
|
|
462
505
|
|
|
463
506
|
---
|
|
464
507
|
|
|
@@ -466,33 +509,35 @@ Full 33-point reference: [MediaPipe Pose Landmarks](https://ai.google.dev/edge/m
|
|
|
466
509
|
|
|
467
510
|
For best results, the camera should see the exerciser from a **side profile**:
|
|
468
511
|
|
|
469
|
-
| ✅ Good
|
|
470
|
-
|
|
|
471
|
-
| Side view, full body visible
|
|
472
|
-
| Phone at waist height, 6-8 ft away | Ground-level angle
|
|
473
|
-
| Well-lit environment
|
|
512
|
+
| ✅ Good | ❌ Bad |
|
|
513
|
+
| --- | --- |
|
|
514
|
+
| Side view, full body visible | Front-facing view |
|
|
515
|
+
| Phone at waist height, 6-8 ft away | Ground-level angle |
|
|
516
|
+
| Well-lit environment | Heavy glare or backlight |
|
|
474
517
|
|
|
475
518
|
---
|
|
476
519
|
|
|
477
520
|
## 🧩 Supported Platforms
|
|
478
521
|
|
|
479
|
-
| Platform
|
|
480
|
-
|
|
|
481
|
-
| **iOS**
|
|
482
|
-
| **Android**
|
|
483
|
-
| **iOS Simulator**
|
|
484
|
-
| **Android Emulator** | ❌ Not supported | No real camera feed
|
|
522
|
+
| Platform | Status | Notes |
|
|
523
|
+
| --- | --- | --- |
|
|
524
|
+
| **iOS** | ✅ Supported | Requires physical device, iOS 14+ (Vision body pose) |
|
|
525
|
+
| **Android** | ✅ Supported | API 23+ (ML Kit), Google Play Services required |
|
|
526
|
+
| **iOS Simulator** | ❌ Not supported | No camera access |
|
|
527
|
+
| **Android Emulator** | ❌ Not supported | No real camera feed |
|
|
485
528
|
|
|
486
529
|
---
|
|
487
530
|
|
|
488
531
|
## 📊 App Size Impact
|
|
489
532
|
|
|
490
|
-
| Component
|
|
491
|
-
|
|
|
492
|
-
|
|
|
493
|
-
|
|
|
494
|
-
|
|
|
495
|
-
| **Total new addition**
|
|
533
|
+
| Component | Size |
|
|
534
|
+
| --- | --- |
|
|
535
|
+
| Nitro module code (Swift + Kotlin) | ~200 KB |
|
|
536
|
+
| ML Kit (Android, via Play Services) | ~0 KB (managed externally) |
|
|
537
|
+
| Vision framework (iOS, built-in) | ~0 KB (system framework) |
|
|
538
|
+
| **Total new addition** | **~200 KB** |
|
|
539
|
+
|
|
540
|
+
Compared to the MediaPipe approach (~11-15 MB), the OS-native approach adds virtually zero app size.
|
|
496
541
|
|
|
497
542
|
---
|
|
498
543
|
|
|
@@ -500,9 +545,9 @@ For best results, the camera should see the exerciser from a **side profile**:
|
|
|
500
545
|
|
|
501
546
|
PRs welcome!
|
|
502
547
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
548
|
+
* [Development Workflow](CONTRIBUTING.md#development-workflow)
|
|
549
|
+
* [Sending a PR](CONTRIBUTING.md#sending-a-pull-request)
|
|
550
|
+
* [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
506
551
|
|
|
507
552
|
---
|
|
508
553
|
|
|
@@ -512,4 +557,4 @@ MIT © [**Gautham Vijayan**](https://gauthamvijay.com)
|
|
|
512
557
|
|
|
513
558
|
---
|
|
514
559
|
|
|
515
|
-
Made with ❤️ and [**Nitro Modules**](https://nitro.margelo.com) + [**VisionCamera**](https://visioncamera.margelo.com) + [**
|
|
560
|
+
Made with ❤️ and [**Nitro Modules**](https://nitro.margelo.com) + [**VisionCamera**](https://visioncamera.margelo.com) + [**Apple Vision**](https://developer.apple.com/documentation/vision) + [**ML Kit**](https://developers.google.com/ml-kit/vision/pose-detection)
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
ext.NitroPoseExercises = [
|
|
3
3
|
kotlinVersion: "2.0.21",
|
|
4
|
-
minSdkVersion:
|
|
4
|
+
minSdkVersion: 26,
|
|
5
5
|
compileSdkVersion: 36,
|
|
6
6
|
targetSdkVersion: 36
|
|
7
7
|
]
|
|
@@ -112,16 +112,15 @@ android {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
repositories {
|
|
116
|
+
google()
|
|
117
|
+
mavenCentral()
|
|
118
|
+
}
|
|
119
|
+
|
|
115
120
|
dependencies {
|
|
116
121
|
implementation "com.facebook.react:react-android"
|
|
117
122
|
implementation project(":react-native-nitro-modules")
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
implementation 'com.google.mediapipe:tasks-vision:0.10.21'
|
|
121
|
-
|
|
122
|
-
// CameraX for ImageProxy access
|
|
123
|
-
implementation 'androidx.camera:camera-core:1.4.1'
|
|
124
|
-
|
|
125
|
-
// VisionCamera — provided by the consuming app
|
|
126
|
-
compileOnly project(':react-native-vision-camera')
|
|
123
|
+
implementation 'com.google.mlkit:pose-detection:18.0.0-beta5'
|
|
124
|
+
implementation project(":react-native-vision-camera")
|
|
127
125
|
}
|
|
126
|
+
|