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

Mediapipe pose abort issue #5495

Open
janaki112 opened this issue Jun 20, 2024 · 5 comments
Open

Mediapipe pose abort issue #5495

janaki112 opened this issue Jun 20, 2024 · 5 comments
Assignees
Labels
legacy:pose Pose Detection related issues platform:javascript MediaPipe Javascript issues type:bug Bug in the Source Code of MediaPipe Solution

Comments

@janaki112
Copy link

janaki112 commented Jun 20, 2024

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

None

OS Platform and Distribution

macOs Sonoma 14.4.0 version

Mobile device if the issue happens on mobile device

No response

Browser and version if the issue happens on browser

Google chrome 125.0.6422.142

Programming Language and version

Javascript

MediaPipe version

0.10.13

Bazel version

No response

Solution

Pose

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

To use smooth landmarks i'm using mediapipe@pose package and for hands i'm using mediapipe task vision solutions , It's causing abort error and sometimes it's giving module.arguments replaced with plain arguments , sometimes memory out of bounds error

Describe the expected behaviour

I should work without any errors

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

For loading pose , i'm using this mediapipe pose is the latest version i'm using 
 loadPoseWeights({url,taskVisionUrl,clientPrompt,componentName}:{url?:string,taskVisionUrl?:string,clientPrompt?:ClientPrompts,componentName:ComponentNames}={componentName:ComponentNames.UNKNOWN}): Observable<{ pose: Pose }> {
    const poseInstance = new Pose({locateFile: (file) => {
      return `https://cdn.jsdelivr.net/npm/@mediapipe/pose/${file}`;
    }});
    poseInstance.setOptions({
      modelComplexity: 2,
      smoothLandmarks: true,
      enableSegmentation: false,
      smoothSegmentation: true,
      minDetectionConfidence: 0.5,
      minTrackingConfidence: 0.5
    });
    return of({pose:poseInstance});
  }
}
For loading hands - 
public handLoadWeights({url,taskVisionUrl,clientPrompt,componentName}:{url?:string,taskVisionUrl?:string,clientPrompt?:ClientPrompts,componentName:ComponentNames}): Observable<{ handPoseLandmarker: HandLandmarker }> {
    return from(tensorFlow.setBackend("webgl")).pipe(
      switchMap(() => (from(FilesetResolver.forVisionTasks(
        taskVisionUrl?taskVisionUrl:ModelWeightsUrls.TASK_VISION
      )))),
      switchMap((vision) => (from(HandLandmarker.createFromOptions(vision, {
        baseOptions: {
          modelAssetPath: url?url:ModelWeightsUrls.HAND
        },
        numHands: 2
      })))),
      map((detector) => ({ handPoseLandmarker: detector })),
      catchError((error) => {
        try{
          this.handleErrorService.handleErrors(EventNames.MEDIAPIPE,componentName,EventsInstants.BEFORE_LOADING,error,clientPrompt?clientPrompt:ClientPrompts.GAME_DELAY,"HAND");
              }
        catch(error){
    
         if(error instanceof CdnError){
          if(error.repeatCount){
            switch(error.name){
              case ErrorNames.TASK_VISION:
                return this.handLoadWeights({taskVisionUrl:error.altUrl,componentName:componentName,clientPrompt:clientPrompt})
              case ErrorNames.WEIGHTS:
                return this.handLoadWeights({url:error.altUrl,componentName:componentName,clientPrompt:clientPrompt});
            }            
          }else{
            this.handleErrorService.handleErrors(EventNames.MEDIAPIPE,componentName,EventsInstants.BEFORE_LOADING,new EndOfRepeatCount(ErrorNames.END_OF_REPEAT_COUNT,ErrorMessages.END_OF_REPEAT_COUNT,ClientPrompts.END_OF_REPEAT_COUNT),ClientPrompts.END_OF_REPEAT_COUNT,"HAND");
          }
           
        }
        }
        return of(error);
      })
    )
  }

Other info / Complete Logs

Uncaught (in promise): RuntimeError: Aborted(Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name))
RuntimeError: Aborted(Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name))
Uncaught Error: Uncaught (in promise): RuntimeError: memory access out of bounds
RuntimeError: memory access out of bounds
 RuntimeError: Aborted(native code called abort())
RuntimeError: Aborted(native code called abort())
@janaki112 janaki112 added the type:bug Bug in the Source Code of MediaPipe Solution label Jun 20, 2024
@kuaashish
Copy link
Collaborator

Hi @janaki112,

You are currently using the legacy MediaPipe Pose solution from here. This version is outdated and no longer maintained. Please switch to the new Pose Landmarker Task API. You can find the overview here, the implementation guide for the web here, and the NPM package here. Please try the new API and let us know if you encounter similar errors.

Thank you!!

@kuaashish kuaashish added legacy:pose Pose Detection related issues platform:javascript MediaPipe Javascript issues stat:awaiting response Waiting for user response labels Jun 20, 2024
@janaki112
Copy link
Author

janaki112 commented Jun 20, 2024

Hi @kuaashish , I used the old solution because of the smooth landmarks option which is being provided, but i didn't find any in the new solution for pose configuration options. Can you please guide me how to get smoothened landmarks?

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Jun 20, 2024
@janaki112
Copy link
Author

Hi @kuaashish , can you please update me regarding smoothening option in pose?

@kuaashish
Copy link
Collaborator

Hi @janaki112,

Please allow us some time to discuss with our team. We will update you on the status.

@janaki112
Copy link
Author

@kuaashish , Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:pose Pose Detection related issues platform:javascript MediaPipe Javascript issues type:bug Bug in the Source Code of MediaPipe Solution
Projects
None yet
Development

No branches or pull requests

2 participants