Skip to content
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

Segment Anything from META: Network implementation. Has someone started already? #6357

Open
vgonzalezd opened this issue Apr 13, 2023 · 7 comments

Comments

@vgonzalezd
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Is it someone implementing in MONAI the segment anything model in MONAI?
https://github.com/facebookresearch/segment-anything
My concern is the weight matching. We can help with it if someone starts already.

Describe the solution you'd like
This will make more students download and use MONAI
For sure it will be an useful network for MONAILABEL

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.

@vgonzalezd vgonzalezd changed the title Segment Anything from google: Network implementation. Does someone started already? Segment Anything from META: Network implementation. Does someone started already? Apr 13, 2023
@vgonzalezd vgonzalezd changed the title Segment Anything from META: Network implementation. Does someone started already? Segment Anything from META: Network implementation. Has someone started already? Apr 13, 2023
@ericspod ericspod moved this to Todo in MONAI v1.3 Jul 11, 2023
@wyli wyli removed the status in MONAI v1.3 Jul 18, 2023
@wyli wyli removed this from MONAI v1.3 Oct 13, 2023
@yashika-git
Copy link
Contributor

@wyli, @ericspod,
Is the implementation of Segment Anything still required?
If yes, can I try working on this?

@KumoLiu
Copy link
Contributor

KumoLiu commented Nov 27, 2023

Hi @yashika-git, yes, welcome to your contribution.
Please refer to the CONTRIBUTION GUIDE as well.

@yashika-git
Copy link
Contributor

Thanks, I've started to look how it can be implemented.

@yashika-git
Copy link
Contributor

Could someone please provide a little more details about the expected outcome of the implementation?
Should the users be able to infer and/or fine-tune the SAM model on custom datasets?
Thank you

@KumoLiu
Copy link
Contributor

KumoLiu commented Dec 20, 2023

Hi @yashika-git, yes first I think we should enable users to load the existing pre-trained weights, also I think they could infer and fine-tune the model on their custom datasets.

@yashika-git
Copy link
Contributor

Hi @KumoLiu, I have a very naive question: What exactly needs to be done to integrate SAM with MONAI? Does it involve modifying SAM's codebase to utilize MONAI's existing code, such as MONAI's networks and layers?
I apologize for the naive question; I'm a beginner in open source and am eager to learn through contributions.

@KumoLiu
Copy link
Contributor

KumoLiu commented Dec 27, 2023

Hi @yashika-git, For existing parts that can be replaced by the MONAI, you should use the components of MONAI as much as possible.

KumoLiu added a commit that referenced this issue Jan 18, 2024
Fixes #7356

### Description

Add relative positinoal embedding in attention block as described in
https://arxiv.org/pdf/2112.01526.pdf
Largely inspired by
https://github.com/facebookresearch/segment-anything/blob/main/segment_anything/modeling/image_encoder.py

Can be useful for #6357

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
- [x] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: vgrau98 <[email protected]>
Signed-off-by: vgrau98 <[email protected]>
Co-authored-by: Eric Kerfoot <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: YunLiu <[email protected]>
marksgraham pushed a commit to marksgraham/MONAI that referenced this issue Jan 30, 2024
Fixes Project-MONAI#7356

### Description

Add relative positinoal embedding in attention block as described in
https://arxiv.org/pdf/2112.01526.pdf
Largely inspired by
https://github.com/facebookresearch/segment-anything/blob/main/segment_anything/modeling/image_encoder.py

Can be useful for Project-MONAI#6357

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
- [x] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: vgrau98 <[email protected]>
Signed-off-by: vgrau98 <[email protected]>
Co-authored-by: Eric Kerfoot <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: YunLiu <[email protected]>
Signed-off-by: Mark Graham <[email protected]>
This was referenced Apr 28, 2024
@KumoLiu KumoLiu removed this from MONAI v1.4 Sep 20, 2024
@KumoLiu KumoLiu moved this to Backlog in MONAI v1.5 Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants