pub struct FaceDetectorYN { /* private fields */ }
Expand description

Implementations§

source§

impl FaceDetectorYN

source

pub fn create( model: &str, config: &str, input_size: Size, score_threshold: f32, nms_threshold: f32, top_k: i32, backend_id: i32, target_id: i32 ) -> Result<Ptr<FaceDetectorYN>>

Creates an instance of this class with given parameters

Parameters
  • model: the path to the requested model
  • config: the path to the config file for compability, which is not requested for ONNX models
  • input_size: the size of the input image
  • score_threshold: the threshold to filter out bounding boxes of score smaller than the given value
  • nms_threshold: the threshold to suppress bounding boxes of IoU bigger than the given value
  • top_k: keep top K bboxes before NMS
  • backend_id: the id of backend
  • target_id: the id of target device
C++ default parameters
  • score_threshold: 0.9f
  • nms_threshold: 0.3f
  • top_k: 5000
  • backend_id: 0
  • target_id: 0
source

pub fn create_def( model: &str, config: &str, input_size: Size ) -> Result<Ptr<FaceDetectorYN>>

Creates an instance of this class with given parameters

Parameters
  • model: the path to the requested model
  • config: the path to the config file for compability, which is not requested for ONNX models
  • input_size: the size of the input image
  • score_threshold: the threshold to filter out bounding boxes of score smaller than the given value
  • nms_threshold: the threshold to suppress bounding boxes of IoU bigger than the given value
  • top_k: keep top K bboxes before NMS
  • backend_id: the id of backend
  • target_id: the id of target device
Note

This alternative version of FaceDetectorYN::create function uses the following default values for its arguments:

  • score_threshold: 0.9f
  • nms_threshold: 0.3f
  • top_k: 5000
  • backend_id: 0
  • target_id: 0

Trait Implementations§

source§

impl Boxed for FaceDetectorYN

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl Debug for FaceDetectorYN

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FaceDetectorYN

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl FaceDetectorYNTrait for FaceDetectorYN

source§

fn as_raw_mut_FaceDetectorYN(&mut self) -> *mut c_void

source§

fn set_input_size(&mut self, input_size: Size) -> Result<()>

Set the size for the network input, which overwrites the input size of creating model. Call this method when the size of input image does not match the input size when creating model Read more
source§

fn get_input_size(&mut self) -> Result<Size>

source§

fn set_score_threshold(&mut self, score_threshold: f32) -> Result<()>

Set the score threshold to filter out bounding boxes of score less than the given value Read more
source§

fn get_score_threshold(&mut self) -> Result<f32>

source§

fn set_nms_threshold(&mut self, nms_threshold: f32) -> Result<()>

Set the Non-maximum-suppression threshold to suppress bounding boxes that have IoU greater than the given value Read more
source§

fn get_nms_threshold(&mut self) -> Result<f32>

source§

fn set_top_k(&mut self, top_k: i32) -> Result<()>

Set the number of bounding boxes preserved before NMS Read more
source§

fn get_top_k(&mut self) -> Result<i32>

source§

fn detect( &mut self, image: &impl ToInputArray, faces: &mut impl ToOutputArray ) -> Result<i32>

Detects faces in the input image. Following is an example output. Read more
source§

impl FaceDetectorYNTraitConst for FaceDetectorYN

source§

impl Send for FaceDetectorYN

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.