I do some experiments with google.mediapipe framework and observing next issue... if some instance/task was initialized, it's impossible to create another instance of inference task after.
For example, I run mediapipe task with pose detection model, and when I try to initialize TextEmbedder instance I receive following exception:
com.google.mediapipe.framework.MediaPipeException: not found: ValidatedGraphConfig Initialization failed. No registered object with name: mediapipe::tasks::text::text_embedder::TextEmbedderGraph; Unable to find Calculator "mediapipe.tasks.text.text_embedder.TextEmbedderGraph" at com.google.mediapipe.framework.Graph.nativeStartRunningGraph(Native Method) at com.google.mediapipe.framework.Graph.startRunningGraph(Graph.java:336) at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:72) at com.google.mediapipe.tasks.text.textembedder.TextEmbedder.createFromOptions(TextEmbedder.java:159)
I run codebase from their examples (pose detection) and added text tasks dependencies to the project. Instantiation:
BaseOptions.Builder baseOptionsBuilder = BaseOptions.builder();
baseOptionsBuilder.setModelAssetPath("universal_sentence_encoder.tflite");
TextEmbedder.TextEmbedderOptions options =
TextEmbedder.TextEmbedderOptions.builder()
.setBaseOptions(baseOptionsBuilder.build())
.build();
mTextEmbedder = TextEmbedder.createFromOptions(context, options);
I tried different versions/combinations (vision & text) so far but no luck so far...
I'm wonder if it's even possible to run 2 instances simultaneously?
UPD: 2 simultaneous instances works fine on iOS