extractEmbeddings
Extract feature embeddings from Segment Anything Model (SAM) encoder
Since R2024a
Description
extracts the feature embeddings of the input image embeddings
= extractEmbeddings(sam
,I
)I
from the encoder
of a Segment Anything Model (SAM), sam
, by running a forward pass on
the neural network.
Note
This functionality requires Deep Learning Toolbox™, Computer Vision Toolbox™, and the Image Processing Toolbox™ Model for Segment Anything Model. You can install the Image Processing Toolbox Model for Segment Anything Model from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
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
uint8
data type. If your input image has a larger data range, rescale the range of pixel values using therescale
function.
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.
Version History
Introduced in R2024a