Skip to content

gapi_parseYolo

gapifunctionOpenCV 5.0.0
import { gapi_parseYolo } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSin_, inSz, confidenceThreshold, nmsThreshold
FUNCTIONgapi_parseYolo
RETURN TYPEtuple_GArray_Rect_and_GArray_int
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Parses output of Yolo network.

Extracts detection information (box, confidence, label) from Yolo output, filters it by given confidence and performs non-maximum suppression for overlapping boxes.

Note: Function textual ID is "org.opencv.nn.parsers.parseYolo"

Note: The default anchor values are specified for YOLO v2 Tiny as described in Intel Open Model Zoo <a href="https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/yolo-v2-tiny-tf/yolo-v2-tiny-tf.md">documentation</a>.

gapi_parseYolo(in_: GMat, inSz: GOpaque_Size, confidenceThreshold: number, nmsThreshold: number, anchors: FloatVector): tuple_GArray_Rect_and_GArray_int;
4 available overloads
gapi_parseYolo(in_: GMat, inSz: GOpaque_Size): tuple_GArray_Rect_and_GArray_int;
gapi_parseYolo(in_: GMat, inSz: GOpaque_Size, confidenceThreshold: number): tuple_GArray_Rect_and_GArray_int;
gapi_parseYolo(in_: GMat, inSz: GOpaque_Size, confidenceThreshold: number, nmsThreshold: number): tuple_GArray_Rect_and_GArray_int;
gapi_parseYolo(in_: GMat, inSz: GOpaque_Size, confidenceThreshold: number, nmsThreshold: number, anchors: FloatVector): tuple_GArray_Rect_and_GArray_int;
in_

Input CV_32F tensor with {1,13,13,N} dimensions, N should satisfy:

\texttt{N} = (\texttt{num_classes} + \texttt{5}) * \texttt{5},

where num_classes - a number of classes Yolo network was trained with.

inSz

Size to project detected boxes to (size of the input image).

confidenceThreshold

If confidence of the detection is smaller than confidence threshold, detection is rejected.

nmsThreshold

Non-maximum suppression threshold which controls minimum relative box intersection area required for rejecting the box with a smaller confidence. If 1.f, nms is not performed and no boxes are rejected.

anchors

Anchors Yolo network was trained with.

Returns

a tuple with a vector of detected boxes and a vector of appropriate labels.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.