extractEmbeddings
Extract feature embeddings from Segment Anything Model (SAM) encoder
Since R2024a
Description
Add-On Required: This feature requires one of these add-ons.
extracts the feature embeddings of the input image embeddings = extractEmbeddings(sam,I)I from the encoder
of a Segment Anything Model (SAM), sam.
Note
To use any of the SAM 2 models, this functionality requires the Image Processing Toolbox™ Model for Segment Anything Model 2 add-on if you use any of the SAM 2 models. To use the base SAM model, this functionality requires the Image Processing Toolbox Model for Segment Anything Model add-on.
Examples
Input Arguments
Output Arguments
Tips
For best model performance, use an image with a data range of [0, 255], such as one with a
uint8data type. If your input image has a larger data range, rescale the range of pixel values using therescalefunction.
References
[1] Kirillov, Alexander, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, et al. "Segment Anything," April 5, 2023. https://doi.org/10.48550/arXiv.2304.02643.
[2] Ravi, Nikhila, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma, Haitham Khedr, et al. “SAM 2: Segment Anything in Images and Videos.” arXiv, October 28, 2024. https://doi.org/10.48550/arXiv.2408.00714.
Version History
Introduced in R2024a


