pub struct MaskDecoder { /* private fields */ }Expand description
The SAM mask decoder.
Implementations§
Source§impl MaskDecoder
impl MaskDecoder
Sourcepub fn forward(
&self,
image_embedding: &FeatureMap,
image_pe: &[f32],
sparse_prompt: &[f32],
dense_prompt: &[f32],
) -> VisionResult<MaskPrediction>
pub fn forward( &self, image_embedding: &FeatureMap, image_pe: &[f32], sparse_prompt: &[f32], dense_prompt: &[f32], ) -> VisionResult<MaskPrediction>
Decode masks from an image embedding and prompt embeddings.
image_embedding: dense(e, grid, grid).image_pe: dense positional encoding(e, grid, grid)(flat).sparse_prompt:[n_sparse · e](may be empty).dense_prompt: dense(e, grid, grid)(flat).
§Errors
VisionError::DimensionMismatchon shape mismatches.VisionError::NonFiniteif any output is non-finite.
Auto Trait Implementations§
impl Freeze for MaskDecoder
impl RefUnwindSafe for MaskDecoder
impl Send for MaskDecoder
impl Sync for MaskDecoder
impl Unpin for MaskDecoder
impl UnsafeUnpin for MaskDecoder
impl UnwindSafe for MaskDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more