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.
Files changed (82) hide show
  1. package/NitroPoseExercises.podspec +2 -1
  2. package/README.md +137 -92
  3. package/android/build.gradle +9 -10
  4. package/android/src/main/java/com/margelo/nitro/nitroposeexercises/NitroPoseExercises.kt +148 -125
  5. package/ios/NitroPoseExercises.swift +113 -88
  6. package/lib/module/config/bicep-curl.js +61 -0
  7. package/lib/module/config/bicep-curl.js.map +1 -0
  8. package/lib/module/config/chair-pose.js +64 -0
  9. package/lib/module/config/chair-pose.js.map +1 -0
  10. package/lib/module/config/cobra-pose.js +57 -0
  11. package/lib/module/config/cobra-pose.js.map +1 -0
  12. package/lib/module/config/downward-dog.js +65 -0
  13. package/lib/module/config/downward-dog.js.map +1 -0
  14. package/lib/module/config/lunge.js +62 -0
  15. package/lib/module/config/lunge.js.map +1 -0
  16. package/lib/module/config/plank.js +57 -0
  17. package/lib/module/config/plank.js.map +1 -0
  18. package/lib/module/config/shoulder-press.js +62 -0
  19. package/lib/module/config/shoulder-press.js.map +1 -0
  20. package/lib/module/config/situp.js +48 -0
  21. package/lib/module/config/situp.js.map +1 -0
  22. package/lib/module/config/squat.js +69 -0
  23. package/lib/module/config/squat.js.map +1 -0
  24. package/lib/module/config/tree-pose.js +57 -0
  25. package/lib/module/config/tree-pose.js.map +1 -0
  26. package/lib/module/config/tricep-dip.js +55 -0
  27. package/lib/module/config/tricep-dip.js.map +1 -0
  28. package/lib/module/config/wall-sit.js +57 -0
  29. package/lib/module/config/wall-sit.js.map +1 -0
  30. package/lib/module/config/warrior-i.js +79 -0
  31. package/lib/module/config/warrior-i.js.map +1 -0
  32. package/lib/module/config/warrior-ii.js +86 -0
  33. package/lib/module/config/warrior-ii.js.map +1 -0
  34. package/lib/module/index.js +19 -0
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/typescript/src/config/bicep-curl.d.ts +3 -0
  37. package/lib/typescript/src/config/bicep-curl.d.ts.map +1 -0
  38. package/lib/typescript/src/config/chair-pose.d.ts +3 -0
  39. package/lib/typescript/src/config/chair-pose.d.ts.map +1 -0
  40. package/lib/typescript/src/config/cobra-pose.d.ts +3 -0
  41. package/lib/typescript/src/config/cobra-pose.d.ts.map +1 -0
  42. package/lib/typescript/src/config/downward-dog.d.ts +3 -0
  43. package/lib/typescript/src/config/downward-dog.d.ts.map +1 -0
  44. package/lib/typescript/src/config/lunge.d.ts +3 -0
  45. package/lib/typescript/src/config/lunge.d.ts.map +1 -0
  46. package/lib/typescript/src/config/plank.d.ts +3 -0
  47. package/lib/typescript/src/config/plank.d.ts.map +1 -0
  48. package/lib/typescript/src/config/shoulder-press.d.ts +3 -0
  49. package/lib/typescript/src/config/shoulder-press.d.ts.map +1 -0
  50. package/lib/typescript/src/config/situp.d.ts +3 -0
  51. package/lib/typescript/src/config/situp.d.ts.map +1 -0
  52. package/lib/typescript/src/config/squat.d.ts +3 -0
  53. package/lib/typescript/src/config/squat.d.ts.map +1 -0
  54. package/lib/typescript/src/config/tree-pose.d.ts +3 -0
  55. package/lib/typescript/src/config/tree-pose.d.ts.map +1 -0
  56. package/lib/typescript/src/config/tricep-dip.d.ts +3 -0
  57. package/lib/typescript/src/config/tricep-dip.d.ts.map +1 -0
  58. package/lib/typescript/src/config/wall-sit.d.ts +3 -0
  59. package/lib/typescript/src/config/wall-sit.d.ts.map +1 -0
  60. package/lib/typescript/src/config/warrior-i.d.ts +3 -0
  61. package/lib/typescript/src/config/warrior-i.d.ts.map +1 -0
  62. package/lib/typescript/src/config/warrior-ii.d.ts +3 -0
  63. package/lib/typescript/src/config/warrior-ii.d.ts.map +1 -0
  64. package/lib/typescript/src/index.d.ts +14 -0
  65. package/lib/typescript/src/index.d.ts.map +1 -1
  66. package/nitro.json +8 -1
  67. package/package.json +10 -10
  68. package/src/config/bicep-curl.ts +64 -0
  69. package/src/config/chair-pose.ts +67 -0
  70. package/src/config/cobra-pose.ts +59 -0
  71. package/src/config/downward-dog.ts +68 -0
  72. package/src/config/lunge.ts +65 -0
  73. package/src/config/plank.ts +59 -0
  74. package/src/config/shoulder-press.ts +63 -0
  75. package/src/config/situp.ts +51 -0
  76. package/src/config/squat.ts +71 -0
  77. package/src/config/tree-pose.ts +59 -0
  78. package/src/config/tricep-dip.ts +58 -0
  79. package/src/config/wall-sit.ts +59 -0
  80. package/src/config/warrior-i.ts +82 -0
  81. package/src/config/warrior-ii.ts +88 -0
  82. 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. Built on **MediaPipe Pose Landmarker** and **VisionCamera v5**.
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
- - 🏋️ **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** — MediaPipe runs on-device via Nitro Modules, zero JS bridge overhead
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
- > - Requires React Native **0.76+** with Nitro Modules and VisionCamera **v5**.
22
- > - Must be tested on a **physical device** — camera + ML inference don't work on simulators.
23
- > - MediaPipe Pose Landmarker model file (`pose_landmarker_lite.task`) must be bundled with the app.
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 **MediaPipe Pose Landmarker** natively on both platforms.
48
- > iOS uses `MediaPipeTasksVision` via CocoaPods.
49
- > Android uses `com.google.mediapipe:tasks-vision` via Gradle.
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 | Description |
75
- | ------------------------ | ------------------------------------------------------------------------- |
76
- | **Rep-Based Exercises** | Cyclic state machine (UP → DOWN → UP = 1 rep). Push-ups, squats, curls. |
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. _(coming soon)_ |
79
- | **Form Feedback** | Angle-based rules with throttled real-time callbacks. |
80
- | **Skeleton Overlay** | 33-point body skeleton drawn over camera via Skia. |
81
- | **Bilateral Tracking** | Left and right side angles tracked independently. |
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
- Download the MediaPipe Pose Landmarker model:
91
+ Unlike MediaPipe-based solutions, this library uses OS-native APIs. There is **no model file to download or bundle**.
90
92
 
91
- ```
92
- https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_lite/float16/latest/pose_landmarker_lite.task
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('pose_landmarker_lite.task');
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 MediaPipe with model file path
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[] // 33 body landmarks from MediaPipe
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; // e.g. 'hipSag'
384
- message: string; // e.g. 'Keep your hips up'
385
- severity: FormSeverity; // 'info' | 'warning' | 'error'
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
- ### Push-Up (`PUSHUP_CONFIG`)
423
+ ### Rep-Based
407
424
 
408
- | Parameter | Value |
409
- | ------------- | ------------------------------------- |
410
- | Type | `rep` |
411
- | Primary Angle | Left elbow (shoulder elbow → wrist) |
412
- | UP Phase | Elbow angle 140°–180° |
413
- | DOWN Phase | Elbow angle 30°–110° |
414
- | Rep Sequence | UP DOWN UP |
415
- | Form Rules | Hip sag detection, hip pike detection |
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 SQUAT_CONFIG: ExerciseConfig = {
423
- name: 'Squat',
424
- type: 'rep',
458
+ const MY_EXERCISE: ExerciseConfig = {
459
+ name: 'Custom Exercise',
460
+ type: 'rep', // 'rep' | 'hold'
425
461
  angles: [
426
- { name: 'leftKnee', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
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: 'leftKnee', minAngle: 160, maxAngle: 180 },
431
- { phase: 'down', angleName: 'leftKnee', minAngle: 50, maxAngle: 110 },
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
- ## 📐 MediaPipe Landmark Index Reference
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 | Index | Landmark |
453
- | ----- | -------------- | ----- | ----------- |
454
- | 0 | Nose | 16 | Right wrist |
455
- | 11 | Left shoulder | 23 | Left hip |
456
- | 12 | Right shoulder | 24 | Right hip |
457
- | 13 | Left elbow | 25 | Left knee |
458
- | 14 | Right elbow | 26 | Right knee |
459
- | 15 | Left wrist | 27 | Left ankle |
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
- Full 33-point reference: [MediaPipe Pose Landmarks](https://ai.google.dev/edge/mediapipe/solutions/vision/pose_landmarker#pose_landmarker_model)
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 | ❌ Bad |
470
- | ---------------------------------- | ------------------------ |
471
- | Side view, full body visible | Front-facing view |
472
- | Phone at waist height, 6-8 ft away | Ground-level angle |
473
- | Well-lit environment | Heavy glare or backlight |
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 | Status | Notes |
480
- | -------------------- | ---------------- | --------------------------------- |
481
- | **iOS** | ✅ Supported | Requires physical device, iOS 14+ |
482
- | **Android** | ✅ Supported | Min SDK 24 (Android 7.0) |
483
- | **iOS Simulator** | ❌ Not supported | No camera access |
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 | Size |
491
- | ---------------------------- | ------------- |
492
- | Pose model (Lite) | ~3 MB |
493
- | MediaPipe SDK (per platform) | ~8–12 MB |
494
- | Nitro module code | ~200 KB |
495
- | **Total new addition** | **~11–15 MB** |
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
- - [Development Workflow](CONTRIBUTING.md#development-workflow)
504
- - [Sending a PR](CONTRIBUTING.md#sending-a-pull-request)
505
- - [Code of Conduct](CODE_OF_CONDUCT.md)
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) + [**MediaPipe**](https://ai.google.dev/edge/mediapipe)
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)
@@ -1,7 +1,7 @@
1
1
  buildscript {
2
2
  ext.NitroPoseExercises = [
3
3
  kotlinVersion: "2.0.21",
4
- minSdkVersion: 24,
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
- // MediaPipe — bundled with your library
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
+