Skip to content

Allow individual-wise confidence arrays#989

Open
ishan372or wants to merge 1 commit into
neuroinformatics-unit:mainfrom
ishan372or:feature/confidence-array-support
Open

Allow individual-wise confidence arrays#989
ishan372or wants to merge 1 commit into
neuroinformatics-unit:mainfrom
ishan372or:feature/confidence-array-support

Conversation

@ishan372or
Copy link
Copy Markdown
Contributor

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

Currently, confidence_array validation only supports keypoint-level confidence arrays with shape (time, keypoint, individual). However, some pose estimation formats such as COCO may provide confidence values at the individual level instead, with shape (time, individual).

This PR is needed to support these valid confidence formats without breaking existing behavior.

What does this PR do?

This PR extends confidence_array validation to support both keypoint-level confidence arrays with shape (time, keypoint, individual) and individual-level confidence arrays with shape (time, individual). Existing validation behavior for invalid shapes is preserved, and _validate_array_shape remains unchanged. In addition, tests were added to cover valid keypoint-level confidence arrays, valid individual-level confidence arrays, and invalid confidence array shapes.

References

Related to COCO-format compatibility discussions.

How has this PR been tested?

The changes were tested locally by instantiating ValidPosesInputs with valid keypoint-level confidence arrays, valid individual-level confidence arrays, and invalid confidence array shapes to verify the expected validation behavior. Validator tests were also run locally using pytest, and existing validation behavior was confirmed to remain unchanged.

Is this a breaking change?

No.

Existing keypoint-level confidence arrays continue to behave as before. This PR only adds support for an additional valid confidence array shape.

Does this PR require an update to the documentation?

Documentation updates are required since this PR extends the accepted confidence_array validation behavior by adding support for individual-level confidence arrays with shape (time, individual). So documentation has to reflect the new available shape of confidence_array.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d17ced0) to head (0543a51).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #989   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           41        41           
  Lines         2824      2829    +5     
=========================================
+ Hits          2824      2829    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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