pub struct Sam2MaskDecoderWeights {Show 27 fields
pub iou_token: Vec<f32>,
pub mask_tokens: Vec<f32>,
pub obj_score_token: Option<Vec<f32>>,
pub transformer: Sam2TwoWayTransformerWeights,
pub upscale_conv1_w: Vec<f32>,
pub upscale_conv1_b: Vec<f32>,
pub upscale_ln_g: Vec<f32>,
pub upscale_ln_b: Vec<f32>,
pub upscale_conv2_w: Vec<f32>,
pub upscale_conv2_b: Vec<f32>,
pub conv_s0_w: Option<Vec<f32>>,
pub conv_s0_b: Option<Vec<f32>>,
pub conv_s1_w: Option<Vec<f32>>,
pub conv_s1_b: Option<Vec<f32>>,
pub hyper_mlps: Vec<Sam2HypernetMlp>,
pub iou_head: Sam2HypernetMlp,
pub iou_use_sigmoid: bool,
pub obj_score_head: Option<Sam2HypernetMlp>,
pub obj_ptr_proj: Option<Sam2HypernetMlp>,
pub transformer_dim: usize,
pub num_mask_tokens: usize,
pub use_high_res_features: bool,
pub pred_obj_scores: bool,
pub use_multimask_token_for_obj_ptr: bool,
pub dynamic_multimask_via_stability: bool,
pub dynamic_multimask_stability_delta: f32,
pub dynamic_multimask_stability_thresh: f32,
}Fields§
§iou_token: Vec<f32>§mask_tokens: Vec<f32>§obj_score_token: Option<Vec<f32>>Optional object-score token, populated when pred_obj_scores=true.
transformer: Sam2TwoWayTransformerWeights§upscale_conv1_w: Vec<f32>ConvTranspose2d in=transformer_dim, out=transformer_dim/4, k=2, s=2.
upscale_conv1_b: Vec<f32>§upscale_ln_g: Vec<f32>§upscale_ln_b: Vec<f32>§upscale_conv2_w: Vec<f32>ConvTranspose2d in=transformer_dim/4, out=transformer_dim/8.
upscale_conv2_b: Vec<f32>§conv_s0_w: Option<Vec<f32>>Optional high-res fusion 1×1 convs.
conv_s0: stride-4 features → transformer_dim/8 channelsconv_s1: stride-8 features → transformer_dim/4 channels
conv_s0_b: Option<Vec<f32>>§conv_s1_w: Option<Vec<f32>>§conv_s1_b: Option<Vec<f32>>§hyper_mlps: Vec<Sam2HypernetMlp>num_mask_tokens × 3-layer ReLU MLPs producing
transformer_dim/8 per mask token.
iou_head: Sam2HypernetMlpIoU prediction head: 3-layer ReLU MLP transformer_dim → iou_head_hidden_dim → iou_head_hidden_dim → num_mask_tokens.
iou_use_sigmoid: booliou_prediction_use_sigmoid flag.
obj_score_head: Option<Sam2HypernetMlp>Optional object-score prediction head (3-layer MLP when the
pred_obj_scores_mlp flag is set; otherwise a plain Linear).
obj_ptr_proj: Option<Sam2HypernetMlp>Optional object-pointer projection MLP. Reference shape:
MLP(transformer_dim, transformer_dim, transformer_dim, 3) if
use_mlp_for_obj_ptr_proj=True, otherwise Linear(...).
transformer_dim: usize§num_mask_tokens: usize§use_high_res_features: bool§pred_obj_scores: bool§use_multimask_token_for_obj_ptr: bool§dynamic_multimask_via_stability: bool§dynamic_multimask_stability_delta: f32§dynamic_multimask_stability_thresh: f32Auto Trait Implementations§
impl Freeze for Sam2MaskDecoderWeights
impl RefUnwindSafe for Sam2MaskDecoderWeights
impl Send for Sam2MaskDecoderWeights
impl Sync for Sam2MaskDecoderWeights
impl Unpin for Sam2MaskDecoderWeights
impl UnsafeUnpin for Sam2MaskDecoderWeights
impl UnwindSafe for Sam2MaskDecoderWeights
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