update selfie-logic#124
Open
WenjinFu wants to merge 3 commits into
Open
Conversation
…nymizationSys/face_recog_stream/selfie_logic.py
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 pull request introduces a new module,
selfie_logic.py, which encapsulates the logic for the selfie enrollment pipeline in a stateless, testable, and reusable way. It also refactors the gallery embedding methods for clarity and batch processing, adds new configuration options for the selfie pipeline, and improves the handling of frame state and sample deduplication. These changes enable robust, multi-frame, quality-gated selfie enrollment with deduplication and identity management.Selfie enrollment pipeline logic:
selfie_logic.pymodule containing all stateless logic for selfie enrollment, including engagement scoring, ambiguity detection, quality checks, identity name validation, deduplication, and running mean updates for multi-frame processing. This centralizes and documents the decision logic, making it reusable and easier to maintain.selfie_logicmodule in the package__init__.py.Gallery embedding and batch enrollment:
_embed_singletoembed_alignedand made it public for use by both internal and external callers (e.g., the selfie pipeline).add_aligned_no_statsmethod togallery.pyfor efficient batch enrollment: allows adding multiple aligned snapshots without recomputing stats after each, and supports passing precomputed embeddings to avoid redundant computation. Also added arecompute_statspublic method for batch stat updates.Selfie pipeline configuration and state:
/config._FrameStateclass to tracklast_ts, a monotonic timestamp used by the selfie pipeline to detect frame changes and prevent redundant processing. [1] [2] [3]Minor improvements:
These changes collectively provide a robust foundation for multi-frame, quality-controlled, and deduplicated selfie enrollment in the system.