SAMed icon indicating copy to clipboard operation
SAMed copied to clipboard

Can SAMed accept prompts to generate masks? If yes, how can it be done?

Open Aimeeman opened this issue 1 year ago • 2 comments

Can SAMed accept prompts to generate masks? If yes, how can it be done?

Aimeeman avatar Jan 26 '24 08:01 Aimeeman

I don't see why it wouldn't be able to accept prompts. Simply modify the code in sam.py.

sparse_embeddings, dense_embeddings = self.prompt_encoder(
            points=None, boxes=None, masks=None
        )

You would probably have to retrain it, as the authors used default embeddings from the image during training I believe.

@hitachinsk lmk if this is correct.

25benjaminli avatar Jan 31 '24 06:01 25benjaminli

Quite interested in this issue, will the SAMed be used under a prompt-able scenario?

Thanks,

xingsanmed avatar May 22 '24 23:05 xingsanmed