I am trying to use mediapipe holistic in flutter android. I tried to follow the documentation but am still quite unsure how to write a BUILD file to build aar. I’ve also read through the documentation but unfortunately the example code provided leads to an non-existing page.
This is what I did:
- Wrote a BUILD file. (The calculator is from https://github.com/google/mediapipe/blob/master/mediapipe/graphs/holistic_tracking/BUILD )
load("//mediapipe/java/com/google/mediapipe:mediapipe_aar.bzl", "mediapipe_aar")
mediapipe_aar(
name = "mp_holistic_tracking",
calculators = ["//mediapipe/graphs/holistic_tracking:holistic_tracking_gpu_deps"],
)
- Then building aar:
bazel build -c opt --strip=ALWAYS --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --fat_apk_cpu=arm64-v8a,armeabi-v7a mp_holistic_tracking.aar
- After this, I pasted the jar file and all the assets into my project.
- The graph (I’ve converted it to binary file)
- The error:
E/native (29489): E20220314 11:02:15.805526 29544 graph.cc:472] ValidatedGraphConfig Initialization failed.
E/native (29489): No registered object with name: HolisticLandmarkGpu; Unable to find Calculator "HolisticLandmarkGpu"
E/native (29489): No registered object with name: HolisticTrackingToRenderData; Unable to find Calculator "HolisticTrackingToRenderData"
D/GlThread(29489): Stopping GL thread ExternalTextureConverter
E/AndroidRuntime(29489): FATAL EXCEPTION: ExternalTextureConverter
E/AndroidRuntime(29489): Process: com.NNJ.mediapipe_holistic_example, PID: 29489
E/AndroidRuntime(29489): com.google.mediapipe.framework.MediaPipeException: not found: ValidatedGraphConfig Initialization failed.
E/AndroidRuntime(29489): No registered object with name: HolisticLandmarkGpu; Unable to find Calculator "HolisticLandmarkGpu"
E/AndroidRuntime(29489): No registered object with name: HolisticTrackingToRenderData; Unable to find Calculator "HolisticTrackingToRenderData"
E/AndroidRuntime(29489): at com.google.mediapipe.framework.Graph.nativeStartRunningGraph(Native Method)
E/AndroidRuntime(29489): at com.google.mediapipe.framework.Graph.startRunningGraph(Graph.java:324)
E/AndroidRuntime(29489): at com.google.mediapipe.components.FrameProcessor.startGraph(FrameProcessor.java:553)
E/AndroidRuntime(29489): at com.google.mediapipe.components.FrameProcessor.maybeAcceptNewFrame(FrameProcessor.java:421)
E/AndroidRuntime(29489): at com.google.mediapipe.components.FrameProcessor.onNewFrame(FrameProcessor.java:439)
E/AndroidRuntime(29489): at com.google.mediapipe.components.ExternalTextureConverter$RenderThread.renderNext(ExternalTextureConverter.java:403)
E/AndroidRuntime(29489): at com.google.mediapipe.components.ExternalTextureConverter$RenderThread.lambda$onFrameAvailable$0$ExternalTextureConverter$RenderThread(ExternalTextureConverter.java:338)
E/AndroidRuntime(29489): at com.google.mediapipe.components.-$$Lambda$ExternalTextureConverter$RenderThread$IXJjtE68JMV2CMJNQcFYhTUqhj8.run(Unknown Source:4)
E/AndroidRuntime(29489): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(29489): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29489): at android.os.Looper.loop(Looper.java:236)
E/AndroidRuntime(29489): at com.google.mediapipe.glutil.GlThread.run(GlThread.java:141)
- Folder structure: folder structure
Am I missing anything? Any help provided will be appreciated, thanks in advance!