Repository navigation
Moh review fixes - #5
Merged
Merged
Conversation
… fill the cap On hardware every placement saturates FRAME_KP_CAP (250), so the old "best 4 by len(kps)" selection was a no-op. Calibration against real captures (8-placement Wine enrollment tiles: pool 493-516 ~= 2x cap; synthetic degradations of a real frame: even half-empty/25%-contrast frames still hit 250) shows the UNCAPPED detector pool is the usable quality signal — see dev/FRAME-QUALITY.md. - extract_frame_native(..., stats=) returns n_pool / cap_score / med_score (pre-cap, output unchanged) - enroll_moh ranks frames by n_pool and recaptures frames with n_pool < min_frame_pool (default FRAME_KP_CAP; kept-on-exhaustion) - per-frame quality logged so hardware runs keep producing calibration data - analysis tooling: dev/analyze_frame_quality.py (synthetic degradations), dev/analyze_real_captures.py (gdb capture mining) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
moh_enrollment: split into capture_frames / build_template / store_template. - A chip rejection of the 0x47 store (bad parent, duplicate, full storage) is deterministic and now fails immediately instead of recapturing all placements up to 6 times behind 'enroll-retry-scan'. - Each failed placement is reported via update_cb(None, e) so fprintd shows a retry cue (the docstring contract, matching the legacy path). - usb.cancel is checked before every capture: wait_int() clears the flag on entry, so a Cancel landing during host-side feature extraction was lost. - `parent` may be a callable resolved only after all captures. sensor.py - enroll(): user lookup/creation moved back to commit time on both paths, so a cancelled first enrollment no longer leaves a finger-less user record and the legacy 138a/9a wire order is unchanged. - capture(): send the 0x04 capture-stop on every interrupted capture (cancel, USB error, scan error), skipping it only after a COMPLETED streamed capture on MoH devices; an a2 rejection of the stop is logged, not raised. NOTE: untested on hardware; the previous code never sent it on a2. - Format the 'Response size does not match' message (was a literal '%d'). moh_native: apply the near-identity sec0_pre patch once in _load_ws_scaffold and assert it patched 6 records, instead of a silent heuristic per template. enroll_moh_chip: --user-sid is parsed with sid_from_string (was passing a str, which identity_to_bytes rejects); --parent no longer defaults to a magic dbid and must be a type-5 USER record. Tests: tests/test_moh_enrollment.py, tests/test_enroll_moh_chip_script.py, scaffold prepatch test (chip/USB layer stubbed, pipeline runs for real). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- moh_native.build_envelope (was _build_envelope) is the single finger envelope builder; Sensor.make_finger_data delegates to it (byte-identical format, pinned by test). Legacy devices now touch moh_native (numpy) at enrollment commit; numpy is already a hard dependency. - moh_native.assemble_template(per_section_kps, subtype) is the shared scaffold → v30 sections → TID → envelope chain; native_template (single frame) and moh_enrollment.build_template (ranked frames) both use it. Dropped the unused native_template(fill_all_sections=) parameter. - store_template uses db.new_record, which gains a `trailer` argument for the uncounted 0x00 byte the type-6 store sends, instead of a duplicate 0x47 implementation. Chip rejections now raise via assert_status. - DEFAULT_SUBTYPE is 0xf5 (the value tested on hardware); the CLI default and help text derive from it instead of a second literal. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
No description provided.