#5772·mediapipe

A small bug where attributes are assigned before the initialization of poseLandmarkerHelper

Author: HenryersCreated Dec 8, 2024Updated Sep 30, 2026
Labelsplatform:androidtype:bugstat:awaiting googlertask:pose landmarker

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

Android 14

Mobile device if the issue happens on mobile device

No response

Browser and version if the issue happens on browser

No response

Programming Language and version

Kotlin

MediaPipe version

No response

Bazel version

No response

Solution

A bug about poseLandmarkerHelper, and I want to provide a solution code for reference.

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

No response

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

At https://github.com/google-ai-edge/mediapipe-samples/blob/main/examples/pose_landmarker/android/app/src/main/java/com/google/mediapipe/examples/poselandmarker/fragment/GalleryFragment.kt, in line 216: "poseLandmarkerHelper.currentModel = p2" But at this time , poseLandmarkerHelper hasn't inited yet.

Describe the expected behaviour

Use "viewModel.setModel(p2)" instead. When we create the object, we can add this line in 282: currentModel = viewModel.currentModel

Standalone code/steps you may have used to try to get what you need

https://github.com/google-ai-edge/mediapipe-samples/blob/main/examples/pose_landmarker/android/app/src/main/java/com/google/mediapipe/examples/poselandmarker/fragment/GalleryFragment.kt, in line 216: "poseLandmarkerHelper.currentModel = p2"

Other info / Complete Logs

bash
Because poseLandmarkerHelper is lateinit, when I want to adjust the parameter "currentModel" before gesture detection of the image, click it, and it will flash back, and then change to my line of code to return to normal.

Source: google-ai-edge/mediapipe