pub struct FaceRecognizerSF { /* private fields */ }
Expand description
DNN-based face recognizer
model download link: https://github.com/opencv/opencv_zoo/tree/master/models/face_recognition_sface
Implementations§
Source§impl FaceRecognizerSF
impl FaceRecognizerSF
Sourcepub fn create(
model: &str,
config: &str,
backend_id: i32,
target_id: i32,
) -> Result<Ptr<FaceRecognizerSF>>
pub fn create( model: &str, config: &str, backend_id: i32, target_id: i32, ) -> Result<Ptr<FaceRecognizerSF>>
Creates an instance of this class with given parameters
§Parameters
- model: the path of the onnx model used for face recognition
- config: the path to the config file for compability, which is not requested for ONNX models
- backend_id: the id of backend
- target_id: the id of target device
§C++ default parameters
- backend_id: 0
- target_id: 0
Sourcepub fn create_def(model: &str, config: &str) -> Result<Ptr<FaceRecognizerSF>>
pub fn create_def(model: &str, config: &str) -> Result<Ptr<FaceRecognizerSF>>
Creates an instance of this class with given parameters
§Parameters
- model: the path of the onnx model used for face recognition
- config: the path to the config file for compability, which is not requested for ONNX models
- backend_id: the id of backend
- target_id: the id of target device
§Note
This alternative version of FaceRecognizerSF::create function uses the following default values for its arguments:
- backend_id: 0
- target_id: 0
Sourcepub fn create_1(
framework: &str,
buffer_model: &Vector<u8>,
buffer_config: &Vector<u8>,
backend_id: i32,
target_id: i32,
) -> Result<Ptr<FaceRecognizerSF>>
pub fn create_1( framework: &str, buffer_model: &Vector<u8>, buffer_config: &Vector<u8>, backend_id: i32, target_id: i32, ) -> Result<Ptr<FaceRecognizerSF>>
Creates an instance of this class from a buffer containing the model weights and configuration.
§Parameters
- framework: Name of the framework (ONNX, etc.)
- bufferModel: A buffer containing the binary model weights.
- bufferConfig: A buffer containing the network configuration.
- backend_id: The id of the backend.
- target_id: The id of the target device.
§Returns
A pointer to the created instance of FaceRecognizerSF.
§C++ default parameters
- backend_id: 0
- target_id: 0
Sourcepub fn create_def_1(
framework: &str,
buffer_model: &Vector<u8>,
buffer_config: &Vector<u8>,
) -> Result<Ptr<FaceRecognizerSF>>
pub fn create_def_1( framework: &str, buffer_model: &Vector<u8>, buffer_config: &Vector<u8>, ) -> Result<Ptr<FaceRecognizerSF>>
Creates an instance of this class from a buffer containing the model weights and configuration.
§Parameters
- framework: Name of the framework (ONNX, etc.)
- bufferModel: A buffer containing the binary model weights.
- bufferConfig: A buffer containing the network configuration.
- backend_id: The id of the backend.
- target_id: The id of the target device.
§Returns
A pointer to the created instance of FaceRecognizerSF.
§Note
This alternative version of FaceRecognizerSF::create function uses the following default values for its arguments:
- backend_id: 0
- target_id: 0
Trait Implementations§
Source§impl Boxed for FaceRecognizerSF
impl Boxed for FaceRecognizerSF
Source§unsafe fn from_raw(
ptr: <FaceRecognizerSF as OpenCVFromExtern>::ExternReceive,
) -> Self
unsafe fn from_raw( ptr: <FaceRecognizerSF as OpenCVFromExtern>::ExternReceive, ) -> Self
Source§fn into_raw(
self,
) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self, ) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSendMut
Source§fn as_raw(&self) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSend
Source§fn as_raw_mut(
&mut self,
) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self, ) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSendMut
Source§impl Debug for FaceRecognizerSF
impl Debug for FaceRecognizerSF
Source§impl Drop for FaceRecognizerSF
impl Drop for FaceRecognizerSF
Source§impl FaceRecognizerSFTrait for FaceRecognizerSF
impl FaceRecognizerSFTrait for FaceRecognizerSF
fn as_raw_mut_FaceRecognizerSF(&mut self) -> *mut c_void
Source§fn feature(
&mut self,
aligned_img: &impl ToInputArray,
face_feature: &mut impl ToOutputArray,
) -> Result<()>
fn feature( &mut self, aligned_img: &impl ToInputArray, face_feature: &mut impl ToOutputArray, ) -> Result<()>
Source§impl FaceRecognizerSFTraitConst for FaceRecognizerSF
impl FaceRecognizerSFTraitConst for FaceRecognizerSF
fn as_raw_FaceRecognizerSF(&self) -> *const c_void
Source§fn align_crop(
&self,
src_img: &impl ToInputArray,
face_box: &impl ToInputArray,
aligned_img: &mut impl ToOutputArray,
) -> Result<()>
fn align_crop( &self, src_img: &impl ToInputArray, face_box: &impl ToInputArray, aligned_img: &mut impl ToOutputArray, ) -> Result<()>
Source§fn match_(
&self,
face_feature1: &impl ToInputArray,
face_feature2: &impl ToInputArray,
dis_type: i32,
) -> Result<f64>
fn match_( &self, face_feature1: &impl ToInputArray, face_feature2: &impl ToInputArray, dis_type: i32, ) -> Result<f64>
Source§fn match__def(
&self,
face_feature1: &impl ToInputArray,
face_feature2: &impl ToInputArray,
) -> Result<f64>
fn match__def( &self, face_feature1: &impl ToInputArray, face_feature2: &impl ToInputArray, ) -> Result<f64>
impl Send for FaceRecognizerSF
Auto Trait Implementations§
impl Freeze for FaceRecognizerSF
impl RefUnwindSafe for FaceRecognizerSF
impl !Sync for FaceRecognizerSF
impl Unpin for FaceRecognizerSF
impl UnwindSafe for FaceRecognizerSF
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
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more