Add unit tests for key_points - skeleton & annotators#2099
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…imports in tests
…ision into tests/key_points
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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:
test/key_points/test_annotators.pywith tests forVertexAnnotator,EdgeAnnotator, andVertexLabelAnnotator, covering default and custom parameters, handling of empty key points, label and color preprocessing, and bounding box calculations.Skeletons Data Structure Testing:
test/key_points/test_skeletons.pywith tests for theSkeletonenum and skeleton-related dictionaries, verifying structure, correct mapping by vertex and edge counts, unique vertex calculations, and prevention of duplicate skeletons.