pub struct InferenceEngine { /* private fields */ }Implementations§
Source§impl InferenceEngine
impl InferenceEngine
Sourcepub fn new() -> Result<Self, Box<dyn Error>>
pub fn new() -> Result<Self, Box<dyn Error>>
Create an engine. Tries to load weights from cog/artifacts/pose_v1.safetensors
(relative to current dir or the cog install dir under
/var/lib/cognitum/apps/pose-estimation/). Returns a usable
engine either way — without weights, infer produces the
stub output.
Sourcepub fn with_weights(weights_path: Option<&Path>) -> Result<Self, Box<dyn Error>>
pub fn with_weights(weights_path: Option<&Path>) -> Result<Self, Box<dyn Error>>
Create an engine with a specific weights path (used by --config
in cog-pose-estimation run). If weights_path is None, the
stub fallback is used.
Sourcepub fn backend(&self) -> &'static str
pub fn backend(&self) -> &'static str
Where the weights actually came from. Useful for the run.started event.
pub fn infer(&self, window: &CsiWindow) -> Result<PoseOutput, Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for InferenceEngine
impl !RefUnwindSafe for InferenceEngine
impl Send for InferenceEngine
impl Sync for InferenceEngine
impl Unpin for InferenceEngine
impl UnsafeUnpin for InferenceEngine
impl !UnwindSafe for InferenceEngine
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