-
-
Notifications
You must be signed in to change notification settings - Fork 625
Face Quality and Adaptive Density-Aware Face Clustering #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rahulharpal1603
merged 7 commits into
AOSSIE-Org:main
from
rohan-pandeyy:feat/adaptive-density-aware-face-clustering
Jun 7, 2026
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bebafe6
feat(backend): implement face quality parsing with DBSCAN and central…
rohan-pandeyy fdccbbe
feat(backend): Include skipped face clusters images logic to backend
rohan-pandeyy 3156996
feat(frontend): add GlobalAlert and skipped face_clusters logic to fr…
rohan-pandeyy e11cc68
tests(backend): add algo check tests for quality check and adaptive e…
rohan-pandeyy 7ad239f
feat: add face quality validation utility and configure clustering pa…
rohan-pandeyy 31b5b59
update face clustering configuration settings and endpoint tests
rohan-pandeyy 188d84f
Resolve merge conflict
rohan-pandeyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import cv2 | ||
| import numpy as np | ||
|
|
||
|
|
||
| def face_passes_quality_gate( | ||
| face_crop: np.ndarray, | ||
| bbox: tuple, # (x1, y1, x2, y2) | ||
| conf_score: float, | ||
| conf_threshold: float, | ||
| blur_threshold: float, | ||
| min_face_size: int, | ||
| ) -> bool: | ||
| """ | ||
| Evaluates a detected face against quality thresholds before it proceeds | ||
| to embedding. All checks must pass for the face to be considered valid. | ||
| """ | ||
| # 1. Completeness check (Confidence) | ||
| if conf_score < conf_threshold: | ||
| return False | ||
|
|
||
| # 2. Size check | ||
| x1, y1, x2, y2 = bbox | ||
| area = (x2 - x1) * (y2 - y1) | ||
| if area < min_face_size: | ||
| return False | ||
|
|
||
| # 3. Blur check | ||
| if len(face_crop.shape) == 3: | ||
| gray = cv2.cvtColor(face_crop, cv2.COLOR_BGR2GRAY) | ||
| else: | ||
| gray = face_crop | ||
|
|
||
| variance = cv2.Laplacian(gray, cv2.CV_64F).var() | ||
| if variance < blur_threshold: | ||
| return False | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| return True | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.