View Source Evision.FaceDetectorYN (Evision v0.1.15)

Link to this section Summary

Types

t()

Type that represents an Evision.FaceDetectorYN struct.

Functions

Creates an instance of this class with given parameters

Creates an instance of this class with given parameters

A simple interface to detect face from given image

A simple interface to detect face from given image

Return
  • retval: Size

Python prototype (for reference):

Return
  • retval: float

Python prototype (for reference):

Return
  • retval: float

Python prototype (for reference):

Return
  • retval: int

Python prototype (for reference):

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

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

Set the score threshold to filter out bounding boxes of score less than the given value

Set the number of bounding boxes preserved before NMS

Link to this section Types

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

Type that represents an Evision.FaceDetectorYN struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

Link to this function

create(model, config, input_size)

View Source
@spec create(binary(), binary(), {number(), number()}) :: t() | {:error, String.t()}

Creates an instance of this class with given parameters

Positional Arguments
  • model: String.

    the path to the requested model

  • config: String.

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

  • input_size: Size.

    the size of the input image

Keyword Arguments
  • score_threshold: float.

    the threshold to filter out bounding boxes of score smaller than the given value

  • nms_threshold: float.

    the threshold to suppress bounding boxes of IoU bigger than the given value

  • top_k: int.

    keep top K bboxes before NMS

  • backend_id: int.

    the id of backend

  • target_id: int.

    the id of target device

Return

Python prototype (for reference):

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

create(model, config, input_size, opts)

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

Creates an instance of this class with given parameters

Positional Arguments
  • model: String.

    the path to the requested model

  • config: String.

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

  • input_size: Size.

    the size of the input image

Keyword Arguments
  • score_threshold: float.

    the threshold to filter out bounding boxes of score smaller than the given value

  • nms_threshold: float.

    the threshold to suppress bounding boxes of IoU bigger than the given value

  • top_k: int.

    keep top K bboxes before NMS

  • backend_id: int.

    the id of backend

  • target_id: int.

    the id of target device

Return

Python prototype (for reference):

create(model, config, input_size[, score_threshold[, nms_threshold[, top_k[, backend_id[, target_id]]]]]) -> retval
@spec detect(t(), Evision.Mat.maybe_mat_in()) ::
  {integer(), Evision.Mat.t()} | {:error, String.t()}

A simple interface to detect face from given image

Positional Arguments
Return
  • retval: int

  • faces: Evision.Mat.

    detection results stored in a cv::Mat

Python prototype (for reference):

detect(image[, faces]) -> retval, faces
Link to this function

detect(self, image, opts)

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

A simple interface to detect face from given image

Positional Arguments
Return
  • retval: int

  • faces: Evision.Mat.

    detection results stored in a cv::Mat

Python prototype (for reference):

detect(image[, faces]) -> retval, faces
@spec getInputSize(t()) :: {number(), number()} | {:error, String.t()}
Return
  • retval: Size

Python prototype (for reference):

getInputSize() -> retval
@spec getNMSThreshold(t()) :: number() | {:error, String.t()}
Return
  • retval: float

Python prototype (for reference):

getNMSThreshold() -> retval
@spec getScoreThreshold(t()) :: number() | {:error, String.t()}
Return
  • retval: float

Python prototype (for reference):

getScoreThreshold() -> retval
@spec getTopK(t()) :: integer() | {:error, String.t()}
Return
  • retval: int

Python prototype (for reference):

getTopK() -> retval
Link to this function

setInputSize(self, input_size)

View Source
@spec setInputSize(
  t(),
  {number(), number()}
) :: :ok | {:error, String.t()}

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

Positional Arguments
  • input_size: Size.

    the size of the input image

Python prototype (for reference):

setInputSize(input_size) -> None
Link to this function

setNMSThreshold(self, nms_threshold)

View Source
@spec setNMSThreshold(t(), number()) :: :ok | {:error, String.t()}

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

Positional Arguments
  • nms_threshold: float.

    threshold for NMS operation

Python prototype (for reference):

setNMSThreshold(nms_threshold) -> None
Link to this function

setScoreThreshold(self, score_threshold)

View Source
@spec setScoreThreshold(t(), number()) :: :ok | {:error, String.t()}

Set the score threshold to filter out bounding boxes of score less than the given value

Positional Arguments
  • score_threshold: float.

    threshold for filtering out bounding boxes

Python prototype (for reference):

setScoreThreshold(score_threshold) -> None
@spec setTopK(t(), integer()) :: :ok | {:error, String.t()}

Set the number of bounding boxes preserved before NMS

Positional Arguments
  • top_k: int.

    the number of bounding boxes to preserve from top rank based on score

Python prototype (for reference):

setTopK(top_k) -> None