Skip to content

[fix] PoseAndFaceDetection's key_frame_body_points output value#12

Open
bowfeng wants to merge 1 commit into
kijai:mainfrom
bowfeng:main
Open

[fix] PoseAndFaceDetection's key_frame_body_points output value#12
bowfeng wants to merge 1 commit into
kijai:mainfrom
bowfeng:main

Conversation

@bowfeng

@bowfeng bowfeng commented Oct 16, 2025

Copy link
Copy Markdown

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

  2. Data Validation & Integrity Checks Added null checks: if each_keypoint has 3 elements

  3. Confidence-Based Filtering Introduced confidence threshold filtering: each_keypoint[2] > 0.6

  4. Skip frame which has fewer points: if len(keypoints_body_list) < 2

  5. Early return when a valid key frame is found

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant