Repository navigation
Stop the scan when a model gives NaN instead of counting it as a pass - #9
Merged
Merged
Conversation
Each check compares a model reading against a limit, and NaN fails every comparison. A NaN liveness score failed `live < kLive` and counted as live; a NaN head pose or gaze came out of the attention check as "ok". Both now end the scan with "error models", so the password is asked for. An OpenCV exception during a scan aborted the engine and dumped core; it now answers "error models" too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
thanks for splitting this out! merging it into the hotfix with #8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the small PR you asked for in #7: the NaN liveness fix on its own, rebased on 1.2.2.
Each scan check compares a model reading against a limit, and NaN fails every comparison. A NaN liveness score failed
live < Liveness::kLive, so on a webcam it counted as live. The attention check has the same hole: a NaN head pose or gaze got past> 0.2,< -kGazeDownand the rest, and came back"ok".Now a reading that is not a number ends the scan with
RESULT error models. The camera turns off, the status goes tounavailableand PAM asks for the password. Nothing counts toward the lockout.The second part: an OpenCV exception thrown during a scan (for example a model that cannot run on its input) used to abort the engine and dump core.
servenow catchescv::Exceptionand answerserror models. PAM fell back to the password before as well, so the change is a prompt answer and no core dump.Identity scores are left alone. In 1.2.2
bestScoreskips an appearance whose mean is NaN (mean > bestis false), so a NaN never reaches the threshold.Validation
makewith the repo's-Wall -Wextraflags: no warnings.omaface-engine selftestpasses with the new binary.Attention::checkwith a real face model load and a NaN head pose:okmodelsCreated with Claude Opus 5.5 in Claude Code.