mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

offer another PyPi build that includes more models, or another method to use heavy model without download?

Open M00NSH0T opened this issue 2 years ago • 4 comments

I'm trying to use mediapipe in a GCP cloud function (Python). My biggest issue is that I want to use models other than the default model (complexity=1) for pose landmark detection. I'm most interested in getting a better segmentation mask from the pose object, so I'd like to opt for the complexity=2 model, but the problem is that this model is not included in the package by default, and the _download_oss_pose_landmark_model(model_complexity) function that gets called when you create a pose object doesn't have the permissions it needs within a GCP cloud function. Plus, I'd rather not have to download a model every time I run the function from a fresh instance...

I created a fork where I downloaded/included the appropriate model I wanted and commented out the call to download the model, but I can't figure out how I can include this in my cloud function. I tried building it again and included it within my cloud function's zip file, but it didn't work. I tried linking to my GitHub repo within the requirements.txt, that failed as well.

The solution I'd love would be if you could create an official 'mediapipe-full' package that includes all the tflite models and put that on PyPi. Would that be possible?

Or do you have any other suggestions for how I might use mediapipe in a cloud function using a 'heavy' model or any other model other than the default one?

thanks!

M00NSH0T avatar Aug 20 '22 14:08 M00NSH0T

and just to clarify the bug I get when I try building it myself, it looks like the same bug that people were getting when trying to install on a raspberry pi, namely:

ModuleNotFoundError: No module named 'mediapipe.python._framework_bindings'

I built it in Ubuntu, then moved the directory from site-packages into my working python directory within the zip file I use to create the Cloud Function. The error above is what shows up in the logs.

M00NSH0T avatar Aug 20 '22 19:08 M00NSH0T

one other solution I just thought of could be to enable users to specify a custom path to whatever model they want to use, instead of just complexity=[0,1,2].

M00NSH0T avatar Aug 21 '22 22:08 M00NSH0T

Hi @M00NSH0T , Do you have still problem w.r.t above issue.

sureshdagooglecom avatar Sep 21 '22 08:09 sureshdagooglecom

Hi @sureshdagooglecom, Yes I'm still struggling with this. Any help would be appreciated. thanks!

M00NSH0T avatar Sep 21 '22 13:09 M00NSH0T

Hello @M00NSH0T, We are upgrading the MediaPipe Legacy Solutions to new MediaPipe solutions However, the libraries, documentation, and source code for all the MediapPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.

You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions. Thank you

kuaashish avatar May 04 '23 10:05 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 May 12 '23 01:05 github-actions[bot]

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

github-actions[bot] avatar May 19 '23 01:05 github-actions[bot]