Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoseLandmarker example help #495

Open
walterf25 opened this issue Jan 25, 2025 · 0 comments
Open

PoseLandmarker example help #495

walterf25 opened this issue Jan 25, 2025 · 0 comments

Comments

@walterf25
Copy link

Discussed in #494

Originally posted by walterf25 January 24, 2025
I 'am able to build and run the PoseLandmarker example in xcode, but I am trying to create a library wrapper to be used in B4X platform which is a platform to build Android and iOS apps using Basic syntax programming language, I am facing an issue when using the following code
`- (MPPPoseLandmarker *)createOptions: (NSString *)tasfilePath :(float)minPoseDetectionConfidence :(float)minPosePresenceConfidence :(float)minTrackingConfidence{
NSError *optionsError = nil;
NSString *modelPath = [[NSBundle mainBundle] pathForResource:tasfilePath ofType:@"task"];

if (!modelPath) {
    NSLog(@"Error: .task file not found in DirAssets.");
} else {
    NSLog(@"Model path: %@", modelPath);
}


MPPPoseLandmarkerOptions *options = [[MPPPoseLandmarkerOptions alloc] init];
options.baseOptions.modelAssetPath = modelPath;
options.baseOptions.delegate = 0;
options.runningMode = MPPRunningModeImage;
options.minPoseDetectionConfidence = minPoseDetectionConfidence;
options.minPosePresenceConfidence = minPosePresenceConfidence;
options.minTrackingConfidence = minTrackingConfidence;
options.shouldOutputSegmentationMasks = false;
options.numPoses = 1;

NSLog(@"options created successfully");

MPPPoseLandmarker *landmarker = [[MPPPoseLandmarker alloc] initWithOptions:options error:&optionsError];

error:&optionsError];
if (optionsError){
NSLog(@"optionsError: %@", optionsError.localizedDescription);
}
return landmarker;
}`

The library wrapper compiles just fine when I use it in B4X and the app runs, the problem is that I see an error when initializing the landmarker with the landmarkeroptions, the errors i 'am seeing is the following

NOT_FOUND: ValidatedGraphConfig Initialization failed.

No registered object with name: mediapipe::tasks::vision::pose_landmarker::PoseLandmarkerGraph; Unable to find Calculator "mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"

The application doesn't crash but it is obvious something is not right, I am using MediaPipeTasksVision.framework version 0.10.20, I also tried version 0.10.14 but I see the same issue, I have both frameworks MediaPipeTasksCommon.framework and MediaPipeTasks.framework referenced in my library wrapper project and i know the task file is being found as I can see the logs the name of the .task file

Model path: /private/var/containers/Bundle/Application/B773963F-D4D6-438E-BAF6-FA0911F44C6F/tros.ai.app/pose_landmarker_heavy.task

I have been at this for days and can not figure out what I must be missing, hopefully I can get some help here from the experts, in advance thanks for the help.

Walter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant