-
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
Bump to 0.0.11 #66
Bump to 0.0.11 #66
Conversation
WalkthroughThis update primarily focuses on enhancing the functionality of label conversion to raw arrays and loading predictions from an SLP file. It also includes a minor version bump for the package. Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Files selected for processing (2)
- README.md (1 hunks)
- sleap_io/init.py (1 hunks)
Files skipped from review due to trivial changes (1)
- sleap_io/init.py
Additional comments (Suppressed): 1
README.md (1)
- 62-64: Ensure that the existing code for creating labels from raw data is compatible with the newly introduced functionalities for converting labels into raw arrays and loading predictions from an SLP file.
### Convert labels to raw arrays | ||
|
||
```py | ||
import sleap_io as sio | ||
|
||
labels = sio.load_slp("tests/data/slp/centered_pair_predictions.slp") | ||
|
||
# Convert predictions to point coordinates in a single array. | ||
trx = labels.numpy() | ||
n_frames, n_tracks, n_nodes, xy = trx.shape | ||
assert xy == 2 | ||
|
||
# Convert to array with confidence scores appended. | ||
trx_with_scores = labels.numpy(return_confidence=True) | ||
n_frames, n_tracks, n_nodes, xy_score = trx.shape | ||
assert xy_score == 3 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new functionality to convert labels into raw arrays and load predictions from an SLP file is well implemented. However, there's a minor issue in line 58 where trx.shape
should be replaced with trx_with_scores.shape
to correctly reflect the shape of the array with confidence scores appended.
- n_frames, n_tracks, n_nodes, xy_score = trx.shape
+ n_frames, n_tracks, n_nodes, xy_score = trx_with_scores.shape
Summary by CodeRabbit