google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.52k stars 5.15k forks source link

A functionality to cache the Wasm runtime and create a new FaceLandmarker, for example with an indexed database or other solution #5146

Open dfbq91 opened 8 months ago

dfbq91 commented 8 months ago

MediaPipe Solution (you are using)

FaceLandmark

Programming language

Javascript

Are you willing to contribute it

None

Describe the feature and the current behaviour/state

I have read the documentation and have not found any way to make the model load faster, or in other words, avoid the execution of FaceLandmarker.createFromOptions in such a way that the two requests (wasm and .task file) are not made to load the model after it was already made once. I have previously achieved it with tensorflow's .save which makes use of indexedDb. I have tried to do it in mediapipe's facelandmark but it is not possible, given the structure of the FaceLandmarker.createFromOptions response. Is there currently a solution for this or is it possible to consider it as a new feature? Thank you so much.

Will this change the current API? How?

No response

Who will benefit with this feature?

Users who use the application again, obtaining faster loading.

Please specify the use cases for this feature

Improved user experience

Any Other info

No response

satorioh commented 5 months ago

Supporting loading and saving models from IndexedDB paths, similar to TensorFlow.js's loadGraphModel and save methods, would enhance the user experience for web applications.