google-ai-edge / mediapipe-samples

Apache License 2.0
1.64k stars 421 forks source link

Multiclass selfie segmentation #164

Open m22cs058 opened 1 year ago

m22cs058 commented 1 year ago

Can you please write a small code in which i can use multiclass selfie segmentation on my local machine?

PaulTR commented 1 year ago

Hey @m22cs058 - I'm not sure I understand the request. Multiclass selfie segmentation should already exist in the category_mask segmentation example. Here's a quick video from that sample: https://photos.app.goo.gl/ia24YF52t7ooHcak9

Edit: So I was just reading an issue for Android and I think I assumed this is for Android :P Do you mean for something like Python? If that's the case, I can add a feature request to my task backlog, but it may not be completed soon.

lambiengcode commented 9 months ago

Hi @PaulTR Tested on Android 11T (21081111RG) works well with CPU delegate but catch "Batch size mismatch" error when modify to GPU. I use this device and use mediapipe studio demo, when selecting Multi-class Selfie Segmenter 256 and GPU it seems to have the same error, I think the problem is the GPU model on this device but when testing other models like Selfie Segmenter, Hair Segmenter and Deeplab V3 with the GPU delegate still working as expected

Log Details:

 E  Image segmenter failed to load model with error: invalid argument: CalculatorGraph::Run() failed in Run: 
                                                                                                    Calculator::Open() for node "mediapipe_tasks_vision_image_segmenter_imagesegmentergraph__mediapipe_tasks_core_inferencesubgraph__inferencecalculator__mediapipe_tasks_vision_image_segmenter_imagesegmentergraph__mediapipe_tasks_core_inferencesubgraph__InferenceCalculator" failed: Batch size mismatch, expected 1 but got 8
PaulTR commented 9 months ago

Going to reopen this for tracking. Will be a bit before I'm back from leave and can look into it, but hopefully someone else from my team can check ti out.

lambiengcode commented 6 months ago

Hi @PaulTR, I'd like to know if there is any update on this?

PaulTR commented 6 months ago

Not yet. Just got back from leave not long ago and right in to Google IO so it'll be a minute before I can find the time to catch back up :) it's definitely on the to-do list though!

On Mon, Apr 29, 2024, 9:46 PM Kai Dao @.***> wrote:

Hi @PaulTR https://github.com/PaulTR, I'd like to know if there is any update on this?

— Reply to this email directly, view it on GitHub https://github.com/googlesamples/mediapipe/issues/164#issuecomment-2084323193, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR2C37VQ2ZZWTT6WGAU7ODY74HY5AVCNFSM6AAAAAAZEUBZKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBUGMZDGMJZGM . You are receiving this because you were mentioned.Message ID: @.***>