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

SAM2 for Edge Detection #483

Open
jaquilio opened this issue Dec 9, 2024 · 0 comments
Open

SAM2 for Edge Detection #483

jaquilio opened this issue Dec 9, 2024 · 0 comments

Comments

@jaquilio
Copy link

jaquilio commented Dec 9, 2024

I am trying to employ SAM2 for edge detection. I use SAM2AutomaticMaskGenerator with all its default parameters to generate the masks and then on each mask returned, I run OpenCV's findContours to get the edges.
I am getting only the outer contours, i.e., the contours of maximal masks. What can I do to get more edges, i.e., get more fine grained masks as well?
I see that SAM2AutomaticMaskGenerator's parameter "multimask_output" is set to True by default and I haven't changed it. With that setting, I was expecting that smaller masks would be returned as well in addition to the enclosing outer masks. But, I am not getting the smaller masks.
Thanks.

@jaquilio jaquilio changed the title Edge Detection SAM2 for Edge Detection Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant