[fix] PoseAndFaceDetection's key_frame_body_points output value#12
Open
bowfeng wants to merge 1 commit into
Open
[fix] PoseAndFaceDetection's key_frame_body_points output value#12bowfeng wants to merge 1 commit into
bowfeng wants to merge 1 commit into
Conversation
This PR enhances the robustness and reliability of the pose keypoint processing pipeline by implementing comprehensive data validation and filtering mechanisms. Changes Made 1. Key Frame Selection Simplification Modified the logic to process only the first frame (key_frame_index = 0) instead of multiple key frames Removed unnecessary loop structures for single-frame processing 2. Data Validation & Integrity Checks Added null checks: if each_keypoint is None Implemented array length validation: len(each_keypoint) != 3 Combined checks using safe short-circuit evaluation 3. Confidence-Based Filtering Introduced confidence threshold filtering: each_keypoint[2] > 0.6 Only processes keypoints with reliable detection scores 4. Empty Result Handling Added safety check before array operations: if len(keypoints_body_list) == 0 Prevents IndexError when no valid keypoints are found Returns empty list gracefully instead of crashing 5. Code Quality Improvements Removed redundant loops for single-frame processing Enhanced error prevention and data validation Improved code readability and maintainability
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 PR enhances the robustness and reliability of the pose keypoint processing pipeline by implementing comprehensive data validation and filtering mechanisms.
Changes Made
Key Frame Selection Simplification Modified the logic to process only the first frame (key_frame_index = 0) instead of multiple key frames
Data Validation & Integrity Checks Added null checks: if each_keypoint has 3 elements
Confidence-Based Filtering Introduced confidence threshold filtering: each_keypoint[2] > 0.6
Skip frame which has fewer points: if len(keypoints_body_list) < 2
Early return when a valid key frame is found