Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Embedding widget for napari plugin #235
Embedding widget for napari plugin #235
Changes from 22 commits
21829d5
ac0412e
d8eb08b
4a2ed76
38734f0
9bbf661
f0b3f49
c18af45
45c1a57
b9c37f0
3405039
0314ef2
522b27b
b39d5c9
174a9c6
147797c
9b1730f
5c573b9
464d7c3
ae9b611
c1fe954
8e75871
1de747e
1c68c03
856da60
bfa8c57
51e96bf
c0c83a4
a4ad1dc
ca3c77e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 20 in micro_sam/sam_annotator/_widgets.py
Codecov / codecov/patch
micro_sam/sam_annotator/_widgets.py#L20
Check warning on line 44 in micro_sam/sam_annotator/_widgets.py
Codecov / codecov/patch
micro_sam/sam_annotator/_widgets.py#L44
Check warning on line 46 in micro_sam/sam_annotator/_widgets.py
Codecov / codecov/patch
micro_sam/sam_annotator/_widgets.py#L46
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.
I think this defeats the purpose of caching the affinities: the idea is that a user can close the annotation tool and open it again later while pointing to the same
save_path
so that the embeddings don't have to be recomputed.This check prevents this and makes caching the embeddings not useful.
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.
This also relates to your comment from above:
Printing the error here is not a good idea. Maybe you intended this because of the problem with the hash comparison, but I don't want to print an error for the correct behavior of using already cached affinities.
We could use a warning instead for now and remove this once we figure out the issue with the hash.
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.
That's reasonable - I've changed the code to fix this problem.
Now it works in all situations:
Check warning on line 50 in micro_sam/sam_annotator/_widgets.py
Codecov / codecov/patch
micro_sam/sam_annotator/_widgets.py#L50
Check warning on line 61 in micro_sam/sam_annotator/_widgets.py
Codecov / codecov/patch
micro_sam/sam_annotator/_widgets.py#L61
Check warning on line 68 in micro_sam/sam_annotator/_widgets.py
Codecov / codecov/patch
micro_sam/sam_annotator/_widgets.py#L66-L68
Check warning on line 74 in micro_sam/sam_annotator/_widgets.py
Codecov / codecov/patch
micro_sam/sam_annotator/_widgets.py#L74
Check warning on line 158 in micro_sam/util.py
Codecov / codecov/patch
micro_sam/util.py#L158