How developers fixed broken GPU hair segmentation on mid-range Android tablets
A team building an on-device virtual hair mirror for salons discovered that MediaPipe's GPU delegate was silently returning empty masks while appearing to function normally, running at 5ms per frame but producing zero usable output. The bug went undetected because the fallback to CPU only triggered on exceptions, and the GPU path threw none. After diagnosing the silent failure, the team rebuilt the inference engine on CPU when no valid mask was detected across five consecutive frames. Further optimisations — including moving pixel recolouring to a fragment shader, reducing segmentation frequency, and switching to a hair-specific 780KB model instead of a 16MB multi-class model — dramatically cut processing time. The combined fixes improved performance from 2 fps to 14 fps on a Samsung A56 and from 9 fps to 15 fps on a Pixel 8 Pro.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in