Skip to content

Fall back when WebGL segmentation mask formats are unsupported#6297

Draft
bc-lee wants to merge 1 commit into
google-ai-edge:masterfrom
bc-lee:feature/mediapipe-web-segmentation-gl-fallback
Draft

Fall back when WebGL segmentation mask formats are unsupported#6297
bc-lee wants to merge 1 commit into
google-ai-edge:masterfrom
bc-lee:feature/mediapipe-web-segmentation-gl-fallback

Conversation

@bc-lee
Copy link
Copy Markdown

@bc-lee bc-lee commented May 19, 2026

Some Android Chrome devices do not expose the WebGL float or half-float render target capabilities required by ImageSegmenter mask postprocessing. On those devices, the GL postprocessor currently fails inside graph execution and can leave the calculator with an empty mask vector, which then triggers a secondary mask-count RET_CHECK.

Treat the missing GL mask format support as an unsupported capability instead of an internal invariant failure. Return FailedPrecondition from the GL postprocessor when neither the float32 path nor the half-float backup path is available, and let the segmentation calculator fall back to the existing CPU postprocessing path for that specific capability failure.

Fixes #6296

Some Android Chrome devices do not expose the WebGL float or half-float
render target capabilities required by ImageSegmenter mask postprocessing.
On those devices, the GL postprocessor currently fails inside graph
execution and can leave the calculator with an empty mask vector, which
then triggers a secondary mask-count RET_CHECK.

Treat the missing GL mask format support as an unsupported capability
instead of an internal invariant failure. Return FailedPrecondition from
the GL postprocessor when neither the float32 path nor the half-float
backup path is available, and let the segmentation calculator fall back
to the existing CPU postprocessing path for that specific capability
failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MediaPipe Web ImageSegmenter aborts instead of falling back or reporting unsupported WebGL float mask postprocessing capability

1 participant