Fix hard-coded identity_scores dimensions in identity accuracy tests#3045
Merged
MMathisLab merged 3 commits intomwm/humanbodyfrom Jul 5, 2025
Merged
Conversation
Co-authored-by: MMathisLab <[email protected]>
Copilot
AI
changed the title
[WIP] Fix failing tests by removing hard-coded number of individuals
Fix hard-coded identity_scores dimensions in identity accuracy tests
Jul 5, 2025
MMathisLab
approved these changes
Jul 5, 2025
Member
|
The file name has a typo: test_meitrcs_identity_accuracy.py ~> metric ... @copilot please fix this |
…s_identity_accuracy.py Co-authored-by: MMathisLab <[email protected]>
Contributor
Author
MMathisLab
approved these changes
Jul 5, 2025
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.
Problem
The tests in
tests/core/metrics/test_meitrcs_identity_accuracy.pywere failing due to hard-codedidentity_scoresarrays that didn't match the number of individuals in the test cases. Specifically, one test case with 3 individuals hadidentity_scoresarrays with only 2 values instead of 3, causing dimension mismatches.Root Cause
The
compute_identity_scoresfunction expectsidentity_scoreswith shape(num_assemblies, num_bodyparts, num_individuals), but the test data had:{ "individuals": ["i1", "i2", "i3"], # 3 individuals "identity_scores": { "img0.png": [ [[0.7, 0.3], [0.6, 0.2]], # Only 2 values, should be 3! # ... ], }, }This created a shape mismatch:
(3, 2, 2)instead of the expected(3, 2, 3).Solution
Fixed the hard-coded test data by adding the missing third value to match the number of individuals:
{ "individuals": ["i1", "i2", "i3"], # 3 individuals "identity_scores": { "img0.png": [ [[0.7, 0.3, 0.0], [0.6, 0.2, 0.2]], # Now has 3 values ✓ [[0.6, 0.3, 0.1], [0.6, 0.2, 0.2]], [[0.6, 0.3, 0.1], [0.6, 0.2, 0.2]], ], }, }Validation
test_meitrcs_identity_accuracy.pynow have correct dimensionstest_apis_evaluate.pyalready uses proper dynamic data generationImpact
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.