mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Mediapipe pose abort issue

Open janaki112 opened this issue 1 year ago • 9 comments

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 avatar Jun 20 '24 10:06 janaki112

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 avatar Jun 20 '24 15:06 kuaashish

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?

janaki112 avatar Jun 20 '24 15:06 janaki112

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

janaki112 avatar Jun 24 '24 06:06 janaki112

Hi @janaki112,

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

kuaashish avatar Jun 24 '24 09:06 kuaashish

@kuaashish , Sure.

janaki112 avatar Jun 24 '24 09:06 janaki112

Hi @yichunk,

Is there a similar method for obtaining smoothing landmarks with the new Task API? In the legacy pose solution, we have a parameter available for smoothing. Your assistance would be beneficial for the community.

Thank you!!

kuaashish avatar Jul 01 '24 08:07 kuaashish

Hi @yichunk , any update regarding smoothing landmarks?

janaki112 avatar Jul 05 '24 12:07 janaki112

Hey @kuaashish , can you please confirm regarding this smoothening parameter?

janaki112 avatar Jul 11 '24 12:07 janaki112

Hi @yichunk , @kuaashish Can you please update me regarding this ?

janaki112 avatar Jul 19 '24 05:07 janaki112