keijiro / BodyPixSentis

BodyPix for Unity Sentis
Apache License 2.0
188 stars 29 forks source link

Does RIght Face include a part of RIght Arm in Body Part Segmentation? #7

Closed daaishi closed 2 years ago

daaishi commented 2 years ago

I'm thinking of making a mask for the head only, but I think it includes the side of the left arm. Is this the specification of the bodypix model?

image

keijiro commented 2 years ago

I don't think so. My visualization shader may work wrong. Did you test the values numerically?

daaishi commented 2 years ago

Thank you for your reply. I did the test.

image

        for (uint part = 0; part < BODYPIX_PART_COUNT; part++)
        {
            // float score = BodyPix_EvalPart(mask, part);
            float score = 0;
            score += lerp(BodyPix_EvalPart(mask, part), 0, abs(sign(part - 0)));
            score += lerp(BodyPix_EvalPart(mask, part), 0, abs(sign(part - 1)));
            score = smoothstep(0.47, 0.58, score);

            acc += HueToRGB((float)part / BODYPIX_PART_COUNT) * score;
            // acc = min(1.0, acc+score);
        }

Do you have any advise?

keijiro commented 2 years ago

Thanks for the clarification. I found a rounding error in BodyPix_EvalPart causing this issue. It's fixed in 2.0.1.

https://github.com/keijiro/BodyPixBarracuda/releases/tag/2.0.1

daaishi commented 2 years ago

Thank you for your update very much!