Loading [MathJax]/extensions/TeX/AMSsymbols.js

View Source Evision.FaceRecognizerSF (Evision v0.2.11)

Summary

Types

t()

Type that represents an FaceRecognizerSF struct.

Functions

Aligns detected face with the source input image and crops it

Aligns detected face with the source input image and crops it

Creates an instance of this class with given parameters

Variant 1:

Creates an instance of this class from a buffer containing the model weights and configuration.

Creates an instance of this class from a buffer containing the model weights and configuration.

Extracts face feature from aligned image

Extracts face feature from aligned image

Calculates the distance between two face features

Calculates the distance between two face features

Types

@type t() :: %Evision.FaceRecognizerSF{ref: reference()}

Type that represents an FaceRecognizerSF struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

@spec alignCrop(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

alignCrop(self, src_img, face_box)

View Source
@spec alignCrop(t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in()) ::
  Evision.Mat.t() | {:error, String.t()}

Aligns detected face with the source input image and crops it

Positional Arguments
  • self: Evision.FaceRecognizerSF.t()

  • src_img: Evision.Mat.

    input image

  • face_box: Evision.Mat.

    the detected face result from the input image

Return
  • aligned_img: Evision.Mat.t().

    output aligned image

Python prototype (for reference only):

alignCrop(src_img, face_box[, aligned_img]) -> aligned_img
Link to this function

alignCrop(self, src_img, face_box, opts)

View Source
@spec alignCrop(
  t(),
  Evision.Mat.maybe_mat_in(),
  Evision.Mat.maybe_mat_in(),
  [{atom(), term()}, ...] | nil
) :: Evision.Mat.t() | {:error, String.t()}

Aligns detected face with the source input image and crops it

Positional Arguments
  • self: Evision.FaceRecognizerSF.t()

  • src_img: Evision.Mat.

    input image

  • face_box: Evision.Mat.

    the detected face result from the input image

Return
  • aligned_img: Evision.Mat.t().

    output aligned image

Python prototype (for reference only):

alignCrop(src_img, face_box[, aligned_img]) -> aligned_img
@spec create(Keyword.t()) :: any() | {:error, String.t()}
@spec create(binary(), binary()) :: t() | {:error, String.t()}

Creates an instance of this class with given parameters

Positional Arguments
  • model: String.

    the path of the onnx model used for face recognition

  • config: String.

    the path to the config file for compability, which is not requested for ONNX models

Keyword Arguments
  • backend_id: integer().

    the id of backend

  • target_id: integer().

    the id of target device

Return
  • retval: Evision.FaceRecognizerSF.t()

Python prototype (for reference only):

create(model, config[, backend_id[, target_id]]) -> retval
Link to this function

create(model, config, opts)

View Source
@spec create(binary(), binary(), [backend_id: term(), target_id: term()] | nil) ::
  t() | {:error, String.t()}
@spec create(binary(), binary(), binary()) :: t() | {:error, String.t()}

Variant 1:

Creates an instance of this class from a buffer containing the model weights and configuration.

Positional Arguments
  • framework: String.

    Name of the framework (ONNX, etc.)

  • bufferModel: [uchar].

    A buffer containing the binary model weights.

  • bufferConfig: [uchar].

    A buffer containing the network configuration.

Keyword Arguments
  • backend_id: integer().

    The id of the backend.

  • target_id: integer().

    The id of the target device.

Return
  • retval: Evision.FaceRecognizerSF.t()

@return A pointer to the created instance of FaceRecognizerSF.

Python prototype (for reference only):

create(framework, bufferModel, bufferConfig[, backend_id[, target_id]]) -> retval

Variant 2:

Creates an instance of this class with given parameters

Positional Arguments
  • model: String.

    the path of the onnx model used for face recognition

  • config: String.

    the path to the config file for compability, which is not requested for ONNX models

Keyword Arguments
  • backend_id: integer().

    the id of backend

  • target_id: integer().

    the id of target device

Return
  • retval: Evision.FaceRecognizerSF.t()

Python prototype (for reference only):

create(model, config[, backend_id[, target_id]]) -> retval
Link to this function

create(framework, bufferModel, bufferConfig, opts)

View Source
@spec create(
  binary(),
  binary(),
  binary(),
  [backend_id: term(), target_id: term()] | nil
) ::
  t() | {:error, String.t()}

Creates an instance of this class from a buffer containing the model weights and configuration.

Positional Arguments
  • framework: String.

    Name of the framework (ONNX, etc.)

  • bufferModel: [uchar].

    A buffer containing the binary model weights.

  • bufferConfig: [uchar].

    A buffer containing the network configuration.

Keyword Arguments
  • backend_id: integer().

    The id of the backend.

  • target_id: integer().

    The id of the target device.

Return
  • retval: Evision.FaceRecognizerSF.t()

@return A pointer to the created instance of FaceRecognizerSF.

Python prototype (for reference only):

create(framework, bufferModel, bufferConfig[, backend_id[, target_id]]) -> retval
@spec feature(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

feature(self, aligned_img)

View Source
@spec feature(t(), Evision.Mat.maybe_mat_in()) ::
  Evision.Mat.t() | {:error, String.t()}

Extracts face feature from aligned image

Positional Arguments
  • self: Evision.FaceRecognizerSF.t()

  • aligned_img: Evision.Mat.

    input aligned image

Return
  • face_feature: Evision.Mat.t().

    output face feature

Python prototype (for reference only):

feature(aligned_img[, face_feature]) -> face_feature
Link to this function

feature(self, aligned_img, opts)

View Source
@spec feature(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | {:error, String.t()}

Extracts face feature from aligned image

Positional Arguments
  • self: Evision.FaceRecognizerSF.t()

  • aligned_img: Evision.Mat.

    input aligned image

Return
  • face_feature: Evision.Mat.t().

    output face feature

Python prototype (for reference only):

feature(aligned_img[, face_feature]) -> face_feature
@spec match(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

match(self, face_feature1, face_feature2)

View Source
@spec match(t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in()) ::
  number() | {:error, String.t()}

Calculates the distance between two face features

Positional Arguments
  • self: Evision.FaceRecognizerSF.t()

  • face_feature1: Evision.Mat.

    the first input feature

  • face_feature2: Evision.Mat.

    the second input feature of the same size and the same type as face_feature1

Keyword Arguments
  • dis_type: integer().

    defines how to calculate the distance between two face features with optional values "FR_COSINE" or "FR_NORM_L2"

Return
  • retval: double

Python prototype (for reference only):

match(face_feature1, face_feature2[, dis_type]) -> retval
Link to this function

match(self, face_feature1, face_feature2, opts)

View Source
@spec match(
  t(),
  Evision.Mat.maybe_mat_in(),
  Evision.Mat.maybe_mat_in(),
  [{:dis_type, term()}] | nil
) ::
  number() | {:error, String.t()}

Calculates the distance between two face features

Positional Arguments
  • self: Evision.FaceRecognizerSF.t()

  • face_feature1: Evision.Mat.

    the first input feature

  • face_feature2: Evision.Mat.

    the second input feature of the same size and the same type as face_feature1

Keyword Arguments
  • dis_type: integer().

    defines how to calculate the distance between two face features with optional values "FR_COSINE" or "FR_NORM_L2"

Return
  • retval: double

Python prototype (for reference only):

match(face_feature1, face_feature2[, dis_type]) -> retval