Async simultaneously loading two mediapipe packages (Hand Pose + Selfie Segmentation) leads to loading error at load time. #2823
Labels
legacy:hands
Hand tracking/gestures/etc
legacy:selfie segmentation
Issues related to selfie segmentation
platform:javascript
MediaPipe Javascript issues
type:feature
Enhancement in the New Functionality or Request for a New Solution
Please make sure that this is a bug and also refer to the troubleshooting, FAQ documentation before raising any issues.
System information (Please provide as much relevant information as possible)
Have I written custom code (as opposed to using a stock example script provided in MediaPipe):
no
OS Platform and Distribution (e.g., Linux Ubuntu 16.04, Android 11, iOS 14.4):
macos 12
Browser and version (e.g. Google Chrome, Safari) if the issue happens on browser:
chrome
Programming Language and version ( e.g. C++, Python, Java):
javascript, node
MediaPipe version:
node_modules/@mediapipe/hands
node_modules/@mediapipe/selfie_segmentation/
Solution ( e.g. FaceMesh, Pose, Holistic ):
Hand Pose + Selfie Segmentation
Describe the current behavior:
Async simultaneously loading two mediapipe packages (Hand Pose + Selfie Segmentation) leads to loading error at load time.
The hands_solution wasm incorrectly inter-loads selfie_segmentation_solution wasm code. We implemented a Mutex to force loading the two packages synchronously to resolve this issue.
Please see below error stack:
Describe the expected behavior:
More than one solution engines should be loaded successfully at the same time.
Standalone code to reproduce the issue:
Provide a reproducible test case that is the bare minimum necessary to replicate the problem. If possible, please share a link to Colab/repo link /any notebook:
From codepen.io, simply run the following:
=======start========
const mpHands = window;
const selfieSegmentation = new SelfieSegmentation({locateFile: (file) => {
return
https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/${file}
;}});
selfieSegmentation.initialize();
const config = {locateFile: (file: string) => {
return
https://cdn.jsdelivr.net/npm/@mediapipe/hands@${mpHands.VERSION}/${file}
;}};
const hands = new mpHands.Hands(config);
hands.initialize()
========end=========
The text was updated successfully, but these errors were encountered: