Skip to content

Handle individual-wise confidence during DLC/LP export#1017

Open
ishan372or wants to merge 2 commits into
neuroinformatics-unit:mainfrom
ishan372or:updatingDLCformat
Open

Handle individual-wise confidence during DLC/LP export#1017
ishan372or wants to merge 2 commits into
neuroinformatics-unit:mainfrom
ishan372or:updatingDLCformat

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?

Datasets with individual-wise confidence scores could not be exported to DeepLabCut (DLC) or LightningPose formats. Exporting such datasets resulted in a dimension mismatch error because these formats expect keypoint-wise confidence scores.

What does this PR do?

Expands individual-wise confidence scores to keypoint-wise confidence scores by assigning the same confidence value to all keypoints belonging to an individual. Emits a logger.warning informing users that the conversion is being performed and that the original individual-wise confidence representation will not be preserved when the exported file is reloaded. Adds tests covering DLC and LightningPose exports with individual-wise confidence scores.

References

#1003

How has this PR been tested?

Reproduced the issue locally using a dataset with individual-wise confidence scores.
Verified that save_poses.to_dlc_style_df() no longer raises an exception.
Verified that save_poses.to_dlc_file() successfully exports datasets with individual-wise confidence scores.
Verified that save_poses.to_lp_file() successfully exports datasets with individual-wise confidence scores.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

Yes.
This PR introduces a new export behaviour for datasets with individual-wise confidence scores. When exporting to formats that only support keypoint-wise confidence scores, individual-wise confidence scores are expanded to all keypoints belonging to an individual.

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

sonarqubecloud Bot commented Jun 1, 2026

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1017   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           41        41           
  Lines         2829      2835    +6     
=========================================
+ Hits          2829      2835    +6     

☔ 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