View Source Evision.DNN.DetectionModel (Evision v0.1.10)

Link to this section Summary

Types

t()

Type that represents an Evision.DNN.DetectionModel struct.

Functions

Given the @p input frame, create input blob, run net and return result detections.

Given the @p input frame, create input blob, run net and return result detections.

Variant 1:

Create model from deep learning network.

Create detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Getter for nmsAcrossClasses. This variable defaults to false, such that when non max suppression is used during the detect() function, it will do so only per-class

nmsAcrossClasses defaults to false, such that when non max suppression is used during the detect() function, it will do so per-class. This function allows you to toggle this behaviour.

Link to this section Types

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

Type that represents an Evision.DNN.DetectionModel struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

@spec detect(t(), Evision.Mat.maybe_mat_in()) ::
  {[integer()], [number()], [{number(), number(), number(), number()}]}
  | {:error, String.t()}

Given the @p input frame, create input blob, run net and return result detections.

Positional Arguments
Keyword Arguments
  • confThreshold: float.

    A threshold used to filter boxes by confidences.

  • nmsThreshold: float.

    A threshold used in non maximum suppression.

Return
  • classIds: [int].

    Class indexes in result detection.

  • confidences: [float].

    A set of corresponding confidences.

  • boxes: [Rect].

    A set of bounding boxes.

Python prototype (for reference):

detect(frame[, confThreshold[, nmsThreshold]]) -> classIds, confidences, boxes
Link to this function

detect(self, frame, opts)

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

Given the @p input frame, create input blob, run net and return result detections.

Positional Arguments
Keyword Arguments
  • confThreshold: float.

    A threshold used to filter boxes by confidences.

  • nmsThreshold: float.

    A threshold used in non maximum suppression.

Return
  • classIds: [int].

    Class indexes in result detection.

  • confidences: [float].

    A set of corresponding confidences.

  • boxes: [Rect].

    A set of bounding boxes.

Python prototype (for reference):

detect(frame[, confThreshold[, nmsThreshold]]) -> classIds, confidences, boxes
@spec detectionModel(Evision.DNN.Net.t()) :: t() | {:error, String.t()}
@spec detectionModel(binary()) :: t() | {:error, String.t()}

Variant 1:

Create model from deep learning network.

Positional Arguments
Return

Python prototype (for reference):

DetectionModel(network) -> <dnn_DetectionModel object>

Variant 2:

Create detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Positional Arguments
  • model: String.

    Binary file contains trained weights.

Keyword Arguments
  • config: String.

    Text file contains network configuration.

Return

Python prototype (for reference):

DetectionModel(model[, config]) -> <dnn_DetectionModel object>
Link to this function

detectionModel(model, opts)

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

Create detection model from network represented in one of the supported formats. An order of @p model and @p config arguments does not matter.

Positional Arguments
  • model: String.

    Binary file contains trained weights.

Keyword Arguments
  • config: String.

    Text file contains network configuration.

Return

Python prototype (for reference):

DetectionModel(model[, config]) -> <dnn_DetectionModel object>
Link to this function

getNmsAcrossClasses(self)

View Source
@spec getNmsAcrossClasses(t()) :: boolean() | {:error, String.t()}

Getter for nmsAcrossClasses. This variable defaults to false, such that when non max suppression is used during the detect() function, it will do so only per-class

Return
  • retval: bool

Python prototype (for reference):

getNmsAcrossClasses() -> retval
Link to this function

setNmsAcrossClasses(self, value)

View Source
@spec setNmsAcrossClasses(t(), boolean()) :: t() | {:error, String.t()}

nmsAcrossClasses defaults to false, such that when non max suppression is used during the detect() function, it will do so per-class. This function allows you to toggle this behaviour.

Positional Arguments
  • value: bool.

    The new value for nmsAcrossClasses

Return

Python prototype (for reference):

setNmsAcrossClasses(value) -> retval