pub struct MaskPrediction {
pub mask_logits: Vec<f32>,
pub iou_pred: Vec<f32>,
pub num_masks: usize,
pub mask_side: usize,
}Expand description
Output of Sam::predict_masks / Sam::forward.
Fields§
§mask_logits: Vec<f32>[num_masks, mask_side, mask_side] mask logits in the encoder’s
4×-upscaled space. Threshold > 0 to get binary masks; further
upscale + crop back to the original image as needed.
iou_pred: Vec<f32>[num_masks] per-mask IoU prediction (model-self-estimated
mask quality).
num_masks: usize§mask_side: usizeImplementations§
Source§impl MaskPrediction
impl MaskPrediction
Sourcepub fn best_by_iou(&self) -> Option<(usize, f32)>
pub fn best_by_iou(&self) -> Option<(usize, f32)>
Convenience: drop the largest predicted-IoU index. Returns
Some((index, iou)).
Auto Trait Implementations§
impl Freeze for MaskPrediction
impl RefUnwindSafe for MaskPrediction
impl Send for MaskPrediction
impl Sync for MaskPrediction
impl Unpin for MaskPrediction
impl UnsafeUnpin for MaskPrediction
impl UnwindSafe for MaskPrediction
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