Model files
The library doesn’t ship a model. You bundle one with your app and pass its file name to usePoseDetection or PoseDetectionOnImage.
Pick a model
Section titled “Pick a model”Google publishes three pose landmarker models. They all output the same 33 landmarks; the bigger ones are more accurate and slower.
| Model | Download | Best for |
|---|---|---|
| Lite | pose_landmarker_lite.task | Live camera on most phones. Start here. |
| Full | pose_landmarker_full.task | Better accuracy on recent devices |
| Heavy | pose_landmarker_heavy.task | Static images, or when accuracy matters more than frame rate |
Bundle it with your app
Section titled “Bundle it with your app”Put the file in a folder in your project, for example assets/models/pose_landmarker_lite.task, and point the config plugin at that folder:
{ "expo": { "plugins": [ ["react-native-mediapipe-posedetection", { "assetsPaths": ["./assets/models/"] }] ] }}On npx expo prebuild the plugin copies every file in that folder to:
- Android:
android/app/src/main/assets/ - iOS: the root of the Xcode project, added to Copy Bundle Resources
Run npx expo prebuild --clean again whenever you add or change a model. See Expo config plugin for all options.
Android: copy the file into android/app/src/main/assets/ (create the folder if it doesn’t exist).
iOS:
- In Xcode, drag the
.taskfile into your app’s project navigator. - Tick Copy items if needed and make sure your app target is checked.
- Under the target’s Build Phases → Copy Bundle Resources, confirm the file is listed.
Referencing the model in code
Section titled “Referencing the model in code”Pass just the file name. The native side looks it up in the app bundle (iOS) or assets folder (Android):
usePoseDetection(callbacks, RunningMode.LIVE_STREAM, 'pose_landmarker_lite.task');