mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

FaceLandmarker.createFromOptions works fine on web and android devices on dev tools, fails on ios devices in dev tools inside a webworker

Open Noob7 opened this issue 1 year ago • 3 comments

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

None

OS Platform and Distribution

Mac chrome google chrome responsive view

Mobile device if the issue happens on mobile device

all simulated iphone devices

Browser and version if the issue happens on browser

chrome Version 119.0.6045.159 (Official Build) (arm64)

Programming Language and version

javascript

MediaPipe version

0.10.3

Bazel version

No response

Solution

FaceLandmarker

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

On simulated ios devices we see an error saying document is not defined

Describe the expected behaviour

Landmarker should be created

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

We have the following code to setup the faceLandmarker. It works fine in chrome. However when we go to responsive view and switch to iphone then it fails with the error :

Uncaught (in promise) ReferenceError: document is not defined
    at la ([email protected]:7:61596)
    at Sa.createFromOptions ([email protected]:7:93494)
    at createFaceLandmarker (worker:21:46)
async function createFaceLandmarker(FaceLandmarker, FilesetResolver) {
  const filesetResolver = await FilesetResolver.forVisionTasks(
    "https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/wasm"
  );
  faceLandmarkerLocal = await FaceLandmarker.createFromOptions(filesetResolver, {
    baseOptions: {
      modelAssetPath:'/models/face_landmarker.task',
      // modelAssetPath: `https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task`,
      delegate: "GPU"
    },
    outputFacialTransformationMatrixes: true,
    runningMode:'IMAGE',
    numFaces: 1
  });
}

Other info / Complete Logs

No response

Noob7 avatar Feb 06 '24 10:02 Noob7

Will take a look.

schmidt-sebastian avatar Feb 08 '24 16:02 schmidt-sebastian

Hi @Noob7,

We are currently investigating this matter. In the meantime, could you please try using the latest available version, which is 0.10.9? It appears that you are currently using an older version 0.10.3.

Thank you!!!

kuaashish avatar Feb 09 '24 07:02 kuaashish

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Mar 05 '24 01:03 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar Mar 13 '24 01:03 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Mar 13 '24 01:03 google-ml-butler[bot]