View Source Evision.Zoo.FaceDetection.YuNet (Evision v0.2.9)
YuNet is a light-weight, fast and accurate face detection model
Summary
Functions
Default configuration.
Docs in smart cell.
Inference.
Initialize model.
Model URL and filename of predefined model.
Set the input size.
Customizable parameters from smart cell.
Smart cell tasks.
Generate quoted code from smart cell attrs.
Visualize the result.
Functions
@spec default_config() :: map()
Default configuration.
@spec docs() :: String.t()
Docs in smart cell.
@spec infer(Evision.FaceDetectorYN.t(), Evision.Mat.maybe_mat_in()) :: Evision.Mat.t() | nil
Inference.
Positional arguments
self:
Evision.FaceDetectorYN.t()
.An initialized FaceDetectorYN model.
image:
Evision.Mat.maybe_mat_in()
.Input image.
@spec init(binary() | :default_model | :quant_model, nil | Keyword.t()) :: {:error, String.t()} | Evision.FaceDetectorYN.t()
Initialize model.
Positional arguments
model:
String.t()
|:default_model |
:quant_model`.When
model
is a string, it will be treat as the path to a weight file andinit/2
will load the model from it.When
model
is either:default_model
or:quant_model
,init/2
will download and load the predefined model.
Keyword arguments
- input_size:
{width=pos_integer(), height=pos_integer()}
setInputSize/2
.Defaults to{320, 320}
.- conf_threshold:
number()
.
0.9
- nms_threshold:
number()
.
0.3
- top_k:
pos_integer()
.
- cache_dir:
String.t()
.
:filename.basedir(:user_cache, "", ...)
- backend:
integer()
.
Evision.Constant.cv_DNN_BACKEND_OPENCV()
.- target:
integer()
.
Evision.Constant.cv_DNN_TARGET_CPU()
.
Model URL and filename of predefined model.
@spec setInputSize( Evision.FaceDetectorYN.t(), {pos_integer(), pos_integer()} ) :: :ok | {:error, String.t()}
Set the input size.
infer/2
will call this function automatically.
Positional arguments
self:
Evision.FaceDetectorYN.t()
.An initialized FaceDetectorYN model.
size:
{width=pos_integer(), height=pos_integer()}
.Input size of the image.
@spec smartcell_params() :: Evision.Zoo.smartcell_params()
Customizable parameters from smart cell.
@spec smartcell_tasks() :: Evision.Zoo.smartcell_tasks()
Smart cell tasks.
A list of variants of the current model.
Generate quoted code from smart cell attrs.
@spec visualize(Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), Keyword.t()) :: Evision.Mat.t()
Visualize the result.
Positional arguments
image:
Evision.Mat.maybe_mat_in()
.Original image.
results:
Evision.Mat.maybe_mat_in()
,nil
.Results given by
infer/2
.
Keyword arguments
box_color:
{blue=integer(), green=integer(), red=integer()}
.Values should be in
[0, 255]
. Defaults to{0, 255, 0}
.Specify the color of the bounding box.
text_color:
{blue=integer(), green=integer(), red=integer()}
.Values should be in
[0, 255]
. Defaults to{0, 0, 255}
.Specify the color of the text (confidence value).
Return
An image with bounding boxes and corresponding confidence values.