Fix default target face handling for empty clusters#1767
Open
duyua9 wants to merge 1 commit intohacksider:mainfrom
Open
Fix default target face handling for empty clusters#1767duyua9 wants to merge 1 commit intohacksider:mainfrom
duyua9 wants to merge 1 commit intohacksider:mainfrom
Conversation
Contributor
Reviewer's GuideHandles clusters with no detected faces in default_target_face without crashing and adds regression tests to verify skipping empty clusters while still processing subsequent ones. Flow diagram for updated default_target_face empty-cluster handlingflowchart TD
A[start_default_target_face] --> B["Initialize best_face and best_frame to None"]
B --> C["For each cluster in clusters"]
C --> D["For each frame in cluster"]
D --> E["For each face in frame"]
E --> F["Update best_face and best_frame if this face is better"]
F --> G["Finished iterating faces in this cluster"]
G --> H{best_face is None or best_frame is None?}
H -->|Yes| I["continue to next cluster (skip empty cluster)"]
I --> C
H -->|No| J["Read target_frame from best_frame location with cv2.imread"]
J --> K["Extract x_min, y_min, x_max, y_max from best_face bbox"]
K --> L["Return chosen target frame and bounding box"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Summary
None.Validation
python3 -m unittest tests/test_face_analyser_default_target.pypython3 -m py_compile modules/face_analyser.py tests/test_face_analyser_default_target.pygit diff --checkbash /Users/ming/.openclaw/skills/code-change-delivery-contract/scripts/scan_delivery_blockers.shSummary by Sourcery
Handle clusters without detected faces when selecting a default target face and add regression coverage for these scenarios.
Bug Fixes:
Tests: