[][src]Struct darknet::Network

pub struct Network { /* fields omitted */ }

Methods

impl Network[src]

pub fn load<C: AsRef<Path> + ?Sized, W: AsRef<Path> + ?Sized>(
    cfg: &C,
    weights: Option<&W>,
    clear: bool,
    labels: Vec<String>
) -> Option<Network>
[src]

Load network from config file cfg (under cfg/ subdir) and weights file weights (can be obtained from https://pjreddie.com/darknet/, optional if training).
clear - Reset network data (used for training).
labels - vector of object labels the model was trained on (i.e. vec!["car", "bird", "dog"...]).

pub fn get_w(&self) -> usize[src]

Network input width.

pub fn get_h(&self) -> usize[src]

Network input height.

pub fn predict(
    &mut self,
    image: &mut Image,
    thresh: f32,
    nms: f32
) -> Detections
[src]

Predict and return object bboxes (with probability > 'thresh').
'nms' - overlap threshold for non-maximum suppression (higher = more overlapping allowed)

pub fn save_weights<P: AsRef<Path> + ?Sized>(&mut self, file_name: &P)[src]

Save network weights to file

pub fn get_labels(&self) -> Vec<String>[src]

Returns vector of object labels

Trait Implementations

impl Drop for Network[src]

Auto Trait Implementations

impl RefUnwindSafe for Network

impl !Send for Network

impl !Sync for Network

impl Unpin for Network

impl UnwindSafe for Network

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.