facebookresearch / segment-anything

The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
Apache License 2.0
47.5k stars 5.62k forks source link

Zero-shot Edge detection code available #226

Closed mickvanhulst closed 1 year ago

mickvanhulst commented 1 year ago

Dear authors,

Thanks a lot for your great work thus far, it's been incredible working with this new technology! I have been experimenting with zero-shot edge detection and I was wondering whether you would be able to provide code examples for the code used in section D.2 of your paper.

Outside of this code being available, I fail to understand how I can get probability maps out of the current model such that I can apply a Gobel filter. A simple way of achieving this would be to apply a Sigmoid over the logits, but I am keen to understand if I am thinking in the right direction.

Thank you!

SpencerWhitehead commented 1 year ago

Hello, thanks for your interest!

We are not intending to release the full evaluation suite as part of this repo at this time. In general, for research-related issues, please reach out to the authors directly instead of using github issues.

Here a few more details that may help clarify things:

ymgw55 commented 1 year ago

Hi @SpencerWhitehead and @mickvanhulst,

Stumbled across this thread and thought it was interesting. I saw that the code for section D.2 isn't being released, so I gave it a shot and tried to implement it myself based on what's in the paper.

I put it up on GitHub in case it might be helpful to someone. It's nothing fancy, but if anyone wants to take a look or has any thoughts on how to improve it, feel free to check it out: https://github.com/ymgw55/segment-anything-edge-detection

Thanks for the cool discussion here!