pub struct Sam2MaskDecoderOutput {
pub masks: Vec<f32>,
pub iou_pred: Vec<f32>,
pub num_masks: usize,
pub h_out: usize,
pub w_out: usize,
pub sam_tokens_out: Vec<f32>,
pub num_ptr_tokens: usize,
pub object_score_logits: Vec<f32>,
pub object_pointer: Option<Vec<f32>>,
}Expand description
Output of mask_decoder_forward.
Fields§
§masks: Vec<f32>[num_masks, h_out, w_out] mask logits. num_masks is 1 or 3
depending on multimask_output (and dynamic-stability fallback).
iou_pred: Vec<f32>§num_masks: usize§h_out: usize§w_out: usize§sam_tokens_out: Vec<f32>Selected mask token(s) for the object-pointer projection.
Shape [num_ptr_tokens, transformer_dim]. None if
use_object_pointer=false.
num_ptr_tokens: usize§object_score_logits: Vec<f32>Object-score logits — [1] per batch when pred_obj_scores=true,
else a constant +10 (matching the reference) so downstream
obj_score_prob evaluates to ~1.
object_pointer: Option<Vec<f32>>Object-pointer projection output [num_ptr_tokens, transformer_dim]. None if use_object_pointer=false.
Auto Trait Implementations§
impl Freeze for Sam2MaskDecoderOutput
impl RefUnwindSafe for Sam2MaskDecoderOutput
impl Send for Sam2MaskDecoderOutput
impl Sync for Sam2MaskDecoderOutput
impl Unpin for Sam2MaskDecoderOutput
impl UnsafeUnpin for Sam2MaskDecoderOutput
impl UnwindSafe for Sam2MaskDecoderOutput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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