computational-cell-analytics / micro-sam

Segment Anything for Microscopy
https://computational-cell-analytics.github.io/micro-sam/
MIT License
324 stars 40 forks source link

Investigate faster SAM implementations and consider changing the default model #186

Open GenevieveBuckley opened 11 months ago

GenevieveBuckley commented 11 months ago

I know there are a whole bunch of projects that popped up after segment-anything was released, but another one we might like to look at and potentially include is FastSAM: https://github.com/CASIA-IVA-Lab/FastSAM

The model checkpoints are linked from the README here: https://github.com/CASIA-IVA-Lab/FastSAM#model-checkpoints

Cross-reference: https://github.com/computational-cell-analytics/micro-sam/pull/174

constantinpape commented 11 months ago

Thanks for the pointer! We're aware of that one already and it's on the list for looking into faster SAM implementations ;). I just went ahead with the vit_t in #174 because it is so easy to integrate.

constantinpape commented 11 months ago

I changed the title to indicate the broader scope. As mentioned, a student will start to work on this mid of October, and @anwai98 and me are already working on better benchmarks for the models (that reflect interactive segmentation quality). See this doc for an overview of our (preliminary) plans for evaluating the faster models.

GenevieveBuckley commented 9 months ago

Just came across another potentially interesting project: https://github.com/SysCV/sam-hq

I haven't looked at this yet, but it might be worth figuring out if it could be useful for microscopy datasets (which are often high resolution images with a lot of fine-grained detail).

constantinpape commented 9 months ago

ALso relevant: https://pytorch.org/blog/accelerating-generative-ai/ https://github.com/pytorch-labs/segment-anything-fast

constantinpape commented 7 months ago

Another candidate: https://arxiv.org/pdf/2312.13789.pdf (similar to MobileSAM, but claims better performance).

constantinpape commented 7 months ago

I tried TinySAM (the method from my previous reply), but it does not work for our data; the bounding box prompt is somehow broken.

image

However, we now have MobileSAM, which also uses a vit_tiny backbone, integrated nicely. Will summarize this soon.

constantinpape commented 5 months ago

Just as a follow up here:

Based on this I think the best strategy is:

constantinpape commented 4 months ago

For the next release we will go with the strategy outlined above, so I removed this issue from the milestone. Will leave it open though for future discussions.