Skip to content

Find faces further away in Reframe's Face mode - #193

Merged
bpacholek merged 1 commit into
mainfrom
182-reframe-full-range
Nov 1, 2026
Merged

bpacholek merged 1 commit into
mainfrom
182-reframe-full-range

Conversation

@bpacholek

Copy link
Copy Markdown
Contributor

Closes #182 (Follow face was done in #190; this is Reframe's Face mode).

Reframe's Face mode found no face in street footage: BlazeFace short range, on the whole frame, needs a face about a sixth of a 16:9 frame wide. #190's squares don't suit it. It has no mask to start from, and the squares find signs, a car's rear and shirts scoring as high as faces.

Change. Reframe's Face mode, the tracking and the board's preview, now uses MediaPipe's full-range BlazeFace on the whole frame:

  • FaceDetector.Range.Full: 192 px input, 48 × 48 anchors, MediaPipe's own threshold 0.6.
  • Follow face keeps short range.
  • The model is face_detection_full_range_sparse.tflite (Apache-2.0, 0.68 MB), downloaded at build time from the file and generation MediaPipe's own build pins (third_party/external_files.bzl) and checked against its SHA-256. It's in docs/third-party.md.

Checked

  • Desktop (the same decoding, in Python with LiteRT), 15 frames of three street clips at 720p:

    Faces found False finds
    Short range none none
    Full range the woman's face, 63 and 80 px wide, at 0.64 and 0.81 none

    The two false finds in a blurred night frame, a shirt and something in a hand, scored 0.53 and 0.56, under the 0.6 threshold. With MediaPipe's test portrait in a 1280 × 720 frame, full range finds the face from about 71 px wide (0.86). Short range finds none.

  • Emulator, a temporary test (not committed): Reframe's face tracking on a 13.5 s street clip at 720p. Short range found a face in 0 of 135 samples, full range in 13, all on the woman, and nothing else. It took 7.0 s against 6.2 s.

  • FaceDetectorTest.fullRangeFindsFacesFurtherAway (new; the close portrait too). FaceTracksTest and ReframerTest pass on the emulator.

🤖 Generated with Claude Code

Reframe's Face mode has no mask to start from, so the squares Follow face
uses for small faces would also frame signs and cars. It now looks at the
whole frame with MediaPipe's full-range BlazeFace (192 px, built into the
APK from the file and generation MediaPipe's own build pins, SHA-256
checked), which finds a face about a twentieth of a 16:9 frame wide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bpacholek
bpacholek merged commit a2f2256 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.

Follow face and Reframe miss faces that are small in the frame

1 participant