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

How to use mediapipe hands javascript model as offline #5729

Open
georgelxl6 opened this issue Nov 14, 2024 · 2 comments
Open

How to use mediapipe hands javascript model as offline #5729

georgelxl6 opened this issue Nov 14, 2024 · 2 comments
Assignees
Labels
os:windows MediaPipe issues on Windows platform:javascript MediaPipe Javascript issues type:support General questions

Comments

@georgelxl6
Copy link

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

None

OS Platform and Distribution

Windows

MediaPipe version

0.4.1675469240

Bazel version

No response

Solution

No response

Programming Language and version

Javascript

Describe the actual behavior

No response

Describe the expected behaviour

No response

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

I am using mediapipe/hands in a web app.
And now finding a way to use this on my local machine offline mode.
Is there any solution?

Other info / Complete Logs

No response

@georgelxl6 georgelxl6 added the type:support General questions label Nov 14, 2024
@kuaashish kuaashish assigned kuaashish and unassigned ayushgdev Nov 15, 2024
@kuaashish kuaashish added os:windows MediaPipe issues on Windows platform:javascript MediaPipe Javascript issues labels Nov 15, 2024
@kuaashish
Copy link
Collaborator

Hi @georgelxl6,

Yes, you can run the npm package offline. However, it seems you are using the legacy @mediapipe/hands package (please correct me if I am wrong). This solution has been upgraded and is now part of the Task Vision package https://www.npmjs.com/package/@mediapipe/tasks-vision. Here's an example implementation for the updated Hand Landmarker:

const vision = await FilesetResolver.forVisionTasks(
    "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision/wasm"
);
const handLandmarker = await HandLandmarker.createFromModelPath(vision,
    "https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task"
);
const image = document.getElementById("image") as HTMLImageElement;
const landmarks = handLandmarker.detect(image);

You can find the Hand Landmarker overview here and the web implementation guide here.(https://ai.google.dev/edge/mediapipe/solutions/vision/hand_landmarker) and Implenetation for Web you can find here.

Please note that support for the old package @mediapipe/hands has been discontinued, as mentioned here. Let us know if you encounter any issues!

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Nov 15, 2024
@georgelxl6
Copy link
Author

georgelxl6 commented Nov 15, 2024

Hi @kuaashish,

Thank you for your response.
Yes, it’s similar to what I’m using now.
However, I’m planning to use it locally.
The link below will not work offline:
https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision/wasm

Thank you

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:windows MediaPipe issues on Windows platform:javascript MediaPipe Javascript issues type:support General questions
Projects
None yet
Development

No branches or pull requests

3 participants