View Source Evision.FaceRecognizerSF (Evision v0.1.38)

Summary

Types

t()

Type that represents an FaceRecognizerSF struct.

Functions

Aligning image to put face on the standard position

Aligning image to put face on the standard position

Creates an instance of this class with given parameters

Creates an instance of this class with given parameters

Extracting face feature from aligned image

Extracting face feature from aligned image

Calculating the distance between two face features

Calculating 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

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()}

Aligning image to put face on the standard position

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

  • src_img: Evision.Mat.t().

    input image

  • face_box: Evision.Mat.t().

    the detection result used for indicate face in 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()}

Aligning image to put face on the standard position

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

  • src_img: Evision.Mat.t().

    input image

  • face_box: Evision.Mat.t().

    the detection result used for indicate face in 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(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: int.

    the id of backend

  • target_id: int.

    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(), [{atom(), term()}, ...] | nil) ::
  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: int.

    the id of backend

  • target_id: int.

    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

feature(self, aligned_img)

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

Extracting face feature from aligned image

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

  • aligned_img: Evision.Mat.t().

    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()}

Extracting face feature from aligned image

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

  • aligned_img: Evision.Mat.t().

    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

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()}

Calculating the distance between two face features

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

  • face_feature1: Evision.Mat.t().

    the first input feature

  • face_feature2: Evision.Mat.t().

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

Keyword Arguments
  • dis_type: int.

    defining the similarity with optional values "FR_OSINE" 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(),
  [{atom(), term()}, ...] | nil
) ::
  number() | {:error, String.t()}

Calculating the distance between two face features

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

  • face_feature1: Evision.Mat.t().

    the first input feature

  • face_feature2: Evision.Mat.t().

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

Keyword Arguments
  • dis_type: int.

    defining the similarity with optional values "FR_OSINE" or "FR_NORM_L2"

Return
  • retval: double

Python prototype (for reference only):

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