-
Notifications
You must be signed in to change notification settings - Fork 91
Add preliminary implementation for SAM2 #1121
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
base: dev
Are you sure you want to change the base?
Conversation
|
Additional TODOs spotted:
EDIT: Naaaah, we are trying to bring single slice segmentation back! ;) |
|
Another comment: I figured out the error for 3d annotator (finally) I'll debug it quickly and try to fix it! |
|
It's fixed now! @constantinpape Can you give it a shot? (by pulling the latest state here and https://github.com/computational-cell-analytics/SAM2_Experiments/pull/43) |
|
I gave it a try and it seems to work better now but is still not very stable. What I tried:
|
|
I also tried with a box prompt first -- the result looked much better, but trying to add more prompts fails with a similar error as before. |
* Test claude code by implementing 'Segment Slice' for SAM2 in the 3D annotator (not yet checked) * Refactor per-slice segmentation into PromptableSegmentation3D class Move SAM2 single-slice segmentation logic from _widgets.py into the PromptableSegmentation3D class for better encapsulation and reusability. This consolidates all SAM2 segmentation functionality in the v2 module. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Refactor SAM2 inference state initialization to use volume directly Replace disk-based frame initialization with direct volume passing in AnnotatorState. This aligns with PromptableSegmentation3D implementation and removes unnecessary disk I/O overhead. Changes: - Remove _sam2_temp_dir attribute - Simplify _initialize_sam2_inference_state to pass volume directly - Remove temporary file cleanup from clear_inference_state Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Simplify and add notes * Clean up * Fix axis order --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This PR adds preliminary (and super dirty) integration of SAM2 to our annotator.
As the current status:
Also, keeping @constantinpape and @caroteu in loop!