Implement batch scoring and enhance existing methods#58
Open
krataratha wants to merge 1 commit into
Open
Conversation
Added get_scores_batch method to calculate SER-FIQ scores for a batch of aligned images efficiently. Updated apply_mtcnn and get_score methods for better functionality.
There was a problem hiding this comment.
Pull request overview
This PR aims to extend the SER_FIQ interface to support efficient SER-FIQ scoring for multiple aligned face images in one call, while also updating/duplicating existing scoring and MTCNN-alignment-related methods.
Changes:
- Added
get_scores_batch(...)to compute SER-FIQ scores for a batch of aligned images by batching forward passes. - Added/updated a
get_score(...)implementation adjacent to the new batch method. - Introduced an apparent duplicated/partial copy of
__init__,apply_mtcnn, andget_scorecontent in the class body (currently breaking the module).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+218
to
+221
| return scores | ||
| gpu:int=0, # Which gpu should be used -> gpu id | ||
| det:int=0, # Mtcnn option, 1= Use R+O, 0=Detect from beginning | ||
| ): |
Comment on lines
+123
to
+126
| def get_score(self, aligned_img : np.ndarray, | ||
| T : int = 100, | ||
| alpha : float = 130.0, | ||
| r : float = 0.88): |
| T : int, optional | ||
| Amount of forward passes to use. The default is 100. | ||
| alpha : float, optional | ||
| Stretching factor, can be choosen to scale the score values |
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.
Added get_scores_batch method to calculate SER-FIQ scores for a batch of aligned images efficiently. Updated apply_mtcnn and get_score methods for better functionality.