Skip to content

Fix mirrored Android background masks after a flipped readback - #242

Open
sierpinskid wants to merge 1 commit into
mainfrom
bugfix/UNI-270-android-mask-readback-layout
Open

sierpinskid wants to merge 1 commit into
mainfrom
bugfix/UNI-270-android-mask-readback-layout

Conversation

@sierpinskid

Copy link
Copy Markdown
Member

Summary

  • Fixes UNI-270. On Android, a portrait background-filter mask is mirrored because the Y flip applied after AsyncGPUReadback is not undone before upload.
  • PersonMaskOrientation.ToReadbackLayout maps the mask back to the readback layout. GLES is still not flipped. Vulkan and Metal still flip once, and that flip is now reversed before SetPixelData.
  • Debug latency logs in the segmenter stay behind STREAM_DEBUG_ENABLED && STREAM_LOG_BG_FILTER. No sample, package, or native binary changes.

Test plan

  • Unity 2021.3.21f1 EditMode: PersonMaskOrientationTests 14 passed, including the new readback round-trip at 0/90/180/270 with and without the Y flip. AndroidMlKitPersonSegmenterTests 1 passed.
  • CI on 2021.3.36f1 and 6000.2.12f1.
  • Android device blur is not claimed by these Editor tests.

Made with Cursor

Undo the post-readback Y flip before upload so a rotated portrait mask lines up with the camera.

Co-authored-by: Cursor <cursoragent@cursor.com>
@getstream-metis

Copy link
Copy Markdown

👋 Hi Daniel, want a second pair of eyes on this?

I'm Jeffery, Stream's review agent. I look for bugs, regressions, missing tests and slow paths, and I only post findings I've checked against the code.

  • Review this PR

Or comment /jeffery review. I'll stay quiet unless you ask.

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.

1 participant