pub struct SegmentAnythingInferenceSettings { /* private fields */ }Expand description
Settings for running inference on SegmentAnything.
Implementations§
Source§impl SegmentAnythingInferenceSettings
impl SegmentAnythingInferenceSettings
Sourcepub fn new<I>(input: I) -> SegmentAnythingInferenceSettings
pub fn new<I>(input: I) -> SegmentAnythingInferenceSettings
Creates a new SegmentAnythingInferenceSettings from an image.
Sourcepub fn set_threshold(self, threshold: f32) -> SegmentAnythingInferenceSettings
pub fn set_threshold(self, threshold: f32) -> SegmentAnythingInferenceSettings
Sets the detection threshold for the mask, 0 is the default value.
- A negative values makes the model return a larger mask.
- A positive makes the model return a smaller mask.
Sourcepub fn add_goal_point(
self,
x: impl Into<f64>,
y: impl Into<f64>,
) -> SegmentAnythingInferenceSettings
pub fn add_goal_point( self, x: impl Into<f64>, y: impl Into<f64>, ) -> SegmentAnythingInferenceSettings
Add a point to the list of points to segment.
Sourcepub fn set_goal_points(
self,
points: Vec<(f64, f64)>,
) -> SegmentAnythingInferenceSettings
pub fn set_goal_points( self, points: Vec<(f64, f64)>, ) -> SegmentAnythingInferenceSettings
Set the list of points to segment.
Sourcepub fn add_avoid_points(
self,
x: impl Into<f64>,
y: impl Into<f64>,
) -> SegmentAnythingInferenceSettings
pub fn add_avoid_points( self, x: impl Into<f64>, y: impl Into<f64>, ) -> SegmentAnythingInferenceSettings
Add a point to the list of points to avoid.
Sourcepub fn set_avoid_points(
self,
points: Vec<(f64, f64)>,
) -> SegmentAnythingInferenceSettings
pub fn set_avoid_points( self, points: Vec<(f64, f64)>, ) -> SegmentAnythingInferenceSettings
Set the list of points to avoid.
Sourcepub fn set_image<I>(
self,
image: I,
) -> Result<SegmentAnythingInferenceSettings, ImageError>
pub fn set_image<I>( self, image: I, ) -> Result<SegmentAnythingInferenceSettings, ImageError>
Set the image to segment.
Auto Trait Implementations§
impl Freeze for SegmentAnythingInferenceSettings
impl RefUnwindSafe for SegmentAnythingInferenceSettings
impl Send for SegmentAnythingInferenceSettings
impl Sync for SegmentAnythingInferenceSettings
impl Unpin for SegmentAnythingInferenceSettings
impl UnwindSafe for SegmentAnythingInferenceSettings
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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