-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add implementation for label-studio annotations and DeepLabCut #20
Conversation
Codecov Report
@@ Coverage Diff @@
## main #20 +/- ##
===========================================
- Coverage 100.00% 93.21% -6.79%
===========================================
Files 10 11 +1
Lines 526 752 +226
===========================================
+ Hits 526 701 +175
- Misses 0 51 +51
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Looking great @quantumdot! Feel free to mark this ready for review for @roomrys whenever you're done. |
Tests failing though on equality comparison.
- For points, each attribute of the point is compared, if they all match, the two points are considered equal. For the X and Y attributes, np.isclose() is utilized so that extremely close points are considered equal. Also, NAN are considered equal. - for instances, we check points by ensuring both instances points contain the same set of nodes, otherwise return false. If they have the same set of nodes, then each node's points between the two instances are compared. If any of these points differ on a node-node basis, the instances are not equal
- compare point coords using np.isclose, to avoid false neg with float stability - make instances implement __eq__, and compare points using above mentioned semantics - add test for close points
needed for DLC data, required by pandas
add a test DLC project for testing data add tests for DLC
Thanks! @roomrys can do the first review. Let's work around the |
CI / Tests are failing on CI / Tests fail on windows |
Hi @quantumdot, Ok, maybe let's split this up into two PRs? You can copy over Talmo |
Closing this PR as it is superseded by the following (these changes split into three separate PRs based on separation of concerns)
|
Description
Add support for label-studio and DeepLabCut
Data Model Changes
Point
s. X and Y coordinates were previously compared using normal float equality semantics. Here we change to utilize thenumpy.isclose()
method for comparison, where two floats are compared for equality within some tolerance (we use just the default tolerances). Additionally, we will consider that two NaN values are equal, which is normally not true.Instance
objects to be compared for equality. Thepoints
collection within an instance are compared with the rule that both collections of points must contain the same set of nodes, and for each node the point must be equal according to the semantics described above.Label Studio Support
list[dict]
and conversion toLabels
instance viasleap_io.io.labelstudio.read_labels()
andsleap_io.io.labelstudio.parse_tasks()
Labels
tolist[dict]
viasleap_io.io.labelstudio.write_labels()
Video
associated with aLabeledFrame
properly implement theVideo.shape
property. If shape is not properly implemented, the label-studio tasks may not function properly.DeepLabCut Support (single- and multi-animal projects)
Labels
instance viasleap_io.io.dlc.load_dlc()
andsleap_io.io.dlc.dlc_to_labels()
.Labels
to DLC annotations viasleap_io.io.dlc.write_dlc()
andsleap_io.io.dlc.labels_to_dlc()
sleap_io.io.dlc.is_multianimal()
Skeleton
data from a DLC project viasleap_io.io.dlc.load_skeletons()
Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP-IO!
❤️