pub struct Sam2PromptEncoderOutput {
pub sparse_embeddings: Vec<f32>,
pub num_sparse_tokens: usize,
pub dense_embeddings: Vec<f32>,
pub image_pe: Vec<f32>,
}Expand description
Output of prompt_encoder_forward — fed straight into the mask
decoder. All host-side Vec<f32>.
Fields§
§sparse_embeddings: Vec<f32>[num_tokens, embed_dim] — concatenation of point and box
embeddings. num_tokens = 0 for the “no prompt” case.
num_sparse_tokens: usize§dense_embeddings: Vec<f32>[embed_dim, grid, grid] — dense pixel-wise embedding.
image_pe: Vec<f32>[embed_dim, grid, grid] — image positional encoding (the
dense PE fed into the mask decoder).
Auto Trait Implementations§
impl Freeze for Sam2PromptEncoderOutput
impl RefUnwindSafe for Sam2PromptEncoderOutput
impl Send for Sam2PromptEncoderOutput
impl Sync for Sam2PromptEncoderOutput
impl Unpin for Sam2PromptEncoderOutput
impl UnsafeUnpin for Sam2PromptEncoderOutput
impl UnwindSafe for Sam2PromptEncoderOutput
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more