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

We need customization option of js version for mediapipe #1741

Closed
vkrytpo opened this issue Mar 13, 2021 · 5 comments
Closed

We need customization option of js version for mediapipe #1741

vkrytpo opened this issue Mar 13, 2021 · 5 comments
Assignees
Labels
platform:javascript MediaPipe Javascript issues task::all All tasks of MediaPipe type:research Model specific questions

Comments

@vkrytpo
Copy link

vkrytpo commented Mar 13, 2021

Hi guys, mediapipe is doing really great, and it's evolution rate is impressive.

problem:
we can customize android, desktop, python verison of mediapipe but we can not do the same for js.
we can build custom AAR, APK as per our requirement (which is much efficient), but we have no such things for js.

usecase: I have created a virtaul try-on for rings using mediapipe which is working fine, but i guess it need optimization for mobile, for that I need to add MedaiPipe PacketCloner as in model graph, but we can not do that normally.

tries:

  1. I have also tried emscripten(to convert C++ to wasm, as you guys also using the same.) and tried to configure it but i guess it takes a lot to configure such a big project and I stucked at error Converting C++ code with MediaPipe library into Web Assembly #877.
  2. Tried saving mediapie online graph runner https://viz.mediapipe.dev/demo/hand_tracking, it's working on my local (with custom graph-models) but i ended up a large js files( though I am trying to understanding it's structure). but as it's generic platform so it won't be that optimized.
  3. Trying tensorflow library (ended up it's too slow, and almost no customization availble there.), and it is using same mediapipe official libraries at backend (also not synced with latest verison).
  4. Trying https://cdn.jsdelivr.net/npm/@mediapipe/ it's working fine but in mobile fps are too low(5-6) which requires customization (addign a PacketCloner can fix this issue.), I am trying to customizing this.

final:
either you guys could make it public (emscripten config for js(/third_party/mediapipe/web folder) - PackedSolution) or add PacketCloner as default with a switch to use it or not.
or atleast share original hands.js(not uglified version)

A little help can spark something great.

@sgowroji sgowroji self-assigned this Mar 15, 2021
@sgowroji sgowroji added task::all All tasks of MediaPipe platform:javascript MediaPipe Javascript issues type:research Model specific questions labels Mar 15, 2021
@sgowroji sgowroji assigned mhays-google and unassigned sgowroji Mar 15, 2021
@sgowroji sgowroji added the stat:awaiting googler Waiting for Google Engineer's Response label Mar 16, 2021
@vkrytpo
Copy link
Author

vkrytpo commented Mar 16, 2021

hey @sgowroji , @mhays-google let me know if I can get help from any of 4 options mentioned in problem.

@tyrmullen
Copy link
Collaborator

  1. This is indeed a bigger project, and requires some more effort, so while it is something we'd like to do, it will be a little while before we can. It's not just a simple matter of exposing configs, because a lot of the sub-libraries themselves are different when being built outside of Google versus inside, so a decent amount of bazel/BUILD engineering will likely be necessary. However, I left a comment on that issue (#877) to hopefully help out any efforts there if that's an avenue people would like to pursue.
  2. I'm surprised the js files are large-- there's a decent amount of JS code required to run the Wasm blob, but I'd imagine the majority of the size would be in the .wasm file, which (for the Visualizer) would just be much larger than you'd need, since it has to include lots of calculators. It should be relatively optimized too, but generally runs ML on CPU, so might not be as fast as the codepens (depending on your platform/device).
  3. I can't really speak to this much at this time.
  4. More customization here is something we're looking into as a logical next step. To kick things off, mhays@ has already released the Typescript defines, which should make the codebase more decipherable (see issue #1408). Hopefully that can help your current experiments while we figure out the customization roadmap!

@sgowroji
Copy link

Hi @vkrytpo, Did you get a chance to go through the above comment. Thanks!

@vKrypto
Copy link

vKrypto commented Apr 12, 2021

@tyrmullen , thanks for the response.

I guess, I can try using ( issue #877) and (issue #1408)

@AndresPrada
Copy link

Hi @vKrypto, did you successfully deploy your own custom JS model following any of the mentioned approaches above? I'm much interested! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:javascript MediaPipe Javascript issues task::all All tasks of MediaPipe type:research Model specific questions
Projects
None yet
Development

No branches or pull requests

6 participants