Skip to content

Follow the face the mask was put on - #175

Merged
bpacholek merged 1 commit into
mainfrom
follow-chosen-face
Nov 1, 2026
Merged

bpacholek merged 1 commit into
mainfrom
follow-chosen-face

Conversation

@bpacholek

Copy link
Copy Markdown
Contributor

Found while blurring faces in the user's night street clip on the emulator (Masks, Mosaic, oval, Follow face).

Before: Follow face always took the detector's surest face at the clip's first frame and followed it from there. Where the user had put the oval made no difference: with a seated person on the left and someone walking on the right, moving the oval onto the walker and turning Follow face on put it back on the seated person.

After: FaceTracking.follow (pure, in core:model) starts at the playhead, where the mask was put. There it takes the face nearest the mask, or the surest face when there is no mask, then follows the nearest face sample by sample, forwards to the end and back to the start. FaceTracks.find takes atUs and near, and the Masks screen passes the mask at the playhead. Reframe still follows the surest face from the start.

On the user's clip the walker's face is a few pixels at the detector's input (BlazeFace short range), so the seated person is the only face found and stays the one followed. The unit test covers the case this changes: two faces seen, and the one under the mask is followed.

Test plan

  • New unit test FaceTrackingTest.theFaceUnderTheMaskIsFollowed: without a mask the surest face, with the mask on the walker the walker in both directions, and gaps stay empty. :core:model:test, :feature:effects:testDebugUnitTest, :core:engine:testDebugUnitTest and spotlessCheck pass.
  • FaceTracksTest and ReframerTest on the emulator pass (3 tests).

🤖 Generated with Claude Code

Follow face took the detector's surest face at the clip's start, so a
mask moved onto someone else jumped back to the first person found.
It now starts where the mask is at the playhead, takes the face nearest
it there (the surest one when there is no mask), and follows that face
forwards and back from there (FaceTracking.follow).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bpacholek
bpacholek merged commit 70d8af4 into main Nov 1, 2026
1 check passed
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