Skip to content

fix(face): use IMAGE running mode so landmarks are detected - #246

Open
rainboy93 wants to merge 1 commit into
pixpark:mainfrom
rainboy93:fix/landmark-image-mode
Open

rainboy93 wants to merge 1 commit into
pixpark:mainfrom
rainboy93:fix/landmark-image-mode

Conversation

@rainboy93

Copy link
Copy Markdown
Contributor

Problem

The face landmarker is constructed with RunningMode::VIDEO. With the bundled mars-face-kit, that mode never emits landmarks for single-frame Detect() calls — a video tracker needs a run of frames to converge, and FaceDetector::Detect passes each frame with timestamp 0. As a result every landmark-driven filter (face reshape, big-eye, lipstick, blusher) silently produces no effect.

Fix

Construct the landmarker with RunningMode::IMAGE, which returns 111 landmarks on the first call. Also surface the mars Init() return code: it was discarded, and LOG_* writes to std::cout (which is /dev/null on Android), so a model that genuinely failed to load was indistinguishable from a working detector that finds no faces.

Notes

Verified on Android (Snapdragon 845): landmarks return on the first call and the reshape/makeup filters take effect.

The face landmarker is constructed with RunningMode::VIDEO. With the
bundled mars-face-kit, that mode never emits landmarks for single-frame
Detect() calls (a video tracker needs a run of frames to converge, and
FaceDetector::Detect passes each frame with timestamp 0), so every
landmark-driven filter — face reshape, big-eye, lipstick, blusher —
silently no-ops. Switching to RunningMode::IMAGE returns 111 landmarks
on the first call.

Also surface the mars Init() return code: it was discarded, and LOG_*
writes to std::cout which is /dev/null on Android, so a model that
failed to load was indistinguishable from a working detector that finds
no faces.

This branch has not been deployed

No deployments
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