-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
integrate SAM (segment anything) encoder with Unet #757
base: main
Are you sure you want to change the base?
Conversation
hi @qubvel is there any update on this? |
make sure you install this package from my fork So far I have been able to train the model, but I can't say it's learning. I'm still struggling there. Also I cannot fit more than 1 sample per batch on a 32gb gpu with a 512 input size. |
@Rusteam how about this: https://github.com/tianrun-chen/SAM-Adapter-PyTorch |
thanks for sharing, I'll try it if my current approach does not work. I've able to get some learning with this transformers notebook |
Hi @Rusteam, thanks a lot for your contribution and sorry for the delay, I am going to review the request and will let you know |
Hey hey hey. While this solution worked I can't say the model was able to learn on my data. We might need to use the version before my ddp adjustments or make the model handle points and boxes as inputs, or use Sam image encoder with unet or other architectures. |
from typing import Optional, Union, List, Tuple | ||
|
||
import torch | ||
from segment_anything.modeling import MaskDecoder, TwoWayTransformer, PromptEncoder |
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.
Is it a pip package? probably need to add to reqs
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.
just added it to reqs, or should we make it optional?
Yes, I was actually thinking about just pre-trained encoder integration, did you test it? |
@qubvel It didn't work with Unet yet, but I can make it work. Which models would be essential to integrate? |
that was my intention as well, but I was unable to make it learn without passing box/point prompts. However, when passing a prompt along with input image, it does learn. We might need to integrate multiple inputs to |
@siddpiku note this try this if you want to use SAM's image encoder with Unet:
|
When I run |
Are you sure you've have installed from my fork? |
@Rusteam if u dont mind can u pls share ur training notebook?? |
My code is in private repo with .py files, can't share. Can you try re-installing the package? Make sure to delete existing one first with |
The following worked for me:
|
@qubvel hey any updates? |
Please add this, this library hasn't have new features for a long time |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days. |
Is this PR ready? |
It's ready. |
The current PR seems to work with image with the size of 1024x1024 only. |
Yes, as the original Sam model |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days. |
Any progress on this? |
Why is the library dying? no new updates in a long time |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days. |
@qubvel can you merge this? It did work |
Closes #756
Added:
vit_h
,vit_b
andvit_l
) to encodersChanged: