Closed roomrys closed 10 months ago
The codebase has been updated to include several changes. The TriangulateSession
class in the commands.py
file now utilizes the itertools.permutations
and itertools.product
imports. Additionally, new static methods have been added to the TriangulateSession
class for calculating reprojection errors and grouping instances and coordinates. The test suite in test_commands.py
has been expanded to accommodate these changes and to update existing test functions for the TriangulateSession
class.
File Path | Summary |
---|---|
sleap/gui/commands.py |
- Added the itertools.permutations and itertools.product imports- Modified the do_action method to use the new TriangulateSession method- Adjusted the verify_views_and_instances method to use the new TriangulateSession method- Added several new static methods in the TriangulateSession class for calculating reprojection errors and grouping instances and coordinates |
tests/gui/test_commands.py |
- Updated test_triangulate_session and test_triangulate_session_get_permutations_of_instances test functions- Added new test functions for TriangulateSession.get_products_of_instances , TriangulateSession.calculate_error_per_frame , and TriangulateSession._get_instance_grouping - Updated test_triangulate_session_get_and_verify_enough_instances function to handle frame_idx instead of frame_inds and removed assertions related to the track parameter- Updated test_triangulate_session_update_instances function to pass instances_and_coordinates[0] to the TriangulateSession.update_instances method |
π A codebase evolves, as changes revolve, π
New methods and tests, in the code's nests, π§ͺ
It's a dance of progress, in the world of bytes, π
As the rabbit hops, and the code delights. π°
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
Attention: 12 lines
in your changes are missing coverage. Please review.
Comparison is base (
9020afb
) 73.76% compared to head (8267345
) 73.81%.
Files | Patch % | Lines |
---|---|---|
sleap/gui/commands.py | 86.36% | 12 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This PR adds a method to get single instance permutations across views (as hypotheses for the selected instance).
Design Decision: Missing
Instance
s ~(To Be Implemented)~~How do we handle the case when the selected instance is not in all views? We would want to create permutations that allow for empty instances in those views. We could essentially create sub-permutations by removing 1 view, then 2 views, and so on until there is only 2 views in the hypothesized frame. We would still need some error threshold to determine whether there is only a single selected instance across views. This will definitely increase the cost and complicate things.~
Update: We opted to add dummy instances for hypothesis testing. Furthermore, higher up in the stacked PRs (#1618), we add an
InstanceGroup
class to hold allInstance
s which are the sameInstance
but across views. Even higher up in the stacked PRs (#1165), we add aFrameGroup
class which holds allLabeledFrame
s that are the sameLabeledFrame
across views.FrameGroup
also manages allInstanceGroup
s for that temporalframe_idx
, including hypothesis generation for "unlocked"Instance
s (i.e.Instance
s that are not in alocked
InstanceGroup
, not assigned/verified by the user).Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart:
Summary by CodeRabbit
New Features
Tests