Skip to content

Add unit tests for key_points - skeleton & annotators#2099

Merged
Borda merged 10 commits intodevelopfrom
tests/key_points
Jan 29, 2026
Merged

Add unit tests for key_points - skeleton & annotators#2099
Borda merged 10 commits intodevelopfrom
tests/key_points

Conversation

@Borda
Copy link
Copy Markdown
Member

@Borda Borda commented Jan 22, 2026

This pull request adds comprehensive unit tests for the key points annotators and skeletons functionality. The new tests ensure the correctness of the annotation logic, label and color preprocessing, and skeleton data structures, thereby improving code reliability and maintainability.

Key Points Annotators Testing:

  • Added test/key_points/test_annotators.py with tests for VertexAnnotator, EdgeAnnotator, and VertexLabelAnnotator, covering default and custom parameters, handling of empty key points, label and color preprocessing, and bounding box calculations.

Skeletons Data Structure Testing:

  • Added test/key_points/test_skeletons.py with tests for the Skeleton enum and skeleton-related dictionaries, verifying structure, correct mapping by vertex and edge counts, unique vertex calculations, and prevention of duplicate skeletons.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60%. Comparing base (b25556d) to head (6a7a033).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #2099   +/-   ##
=======================================
  Coverage       59%     60%           
=======================================
  Files           61      61           
  Lines         7118    7118           
=======================================
+ Hits          4229    4259   +30     
+ Misses        2889    2859   -30     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Borda
Copy link
Copy Markdown
Member Author

Borda commented Jan 22, 2026

waiting on landing #2093 for using assert_image_mostly_same and on #2094 to move it to helpers as shared function...

@Borda Borda marked this pull request as ready for review January 29, 2026 16:21
@Borda Borda requested a review from SkalskiP as a code owner January 29, 2026 16:21
Copilot AI review requested due to automatic review settings January 29, 2026 16:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds unit tests for the key points annotators and skeletons functionality in the supervision library. The tests aim to improve code reliability and maintainability by verifying annotation logic, skeleton data structures, and handling of edge cases.

Changes:

  • Added comprehensive skeleton enum and dictionary mapping tests
  • Added tests for VertexAnnotator and EdgeAnnotator classes covering default parameters, custom configurations, and empty key points
  • Created shared test fixtures for key points testing

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
test/key_points/test_skeletons.py Tests for Skeleton enum structure, SKELETONS_BY_EDGE_COUNT and SKELETONS_BY_VERTEX_COUNT dictionary mappings, and vertex calculations
test/key_points/test_annotators.py Tests for VertexAnnotator and EdgeAnnotator classes, including default/custom parameters, empty key points, and edge case handling
test/conftest.py Shared pytest fixtures for key points tests including scene, sample_key_points, and empty_key_points

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/key_points/test_annotators.py
Comment thread test/conftest.py
Comment thread test/key_points/test_skeletons.py Outdated
Comment thread test/key_points/test_skeletons.py Outdated
Comment thread test/key_points/test_annotators.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/key_points/test_skeletons.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Borda Borda merged commit 5ced8c4 into develop Jan 29, 2026
26 checks passed
@Borda Borda deleted the tests/key_points branch January 29, 2026 17:22
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.

2 participants