ailia  1.3.0.0
Classes | Public Member Functions | Public Attributes | List of all members
AiliaDetector Class Reference

Classes

class  AILIADetectorObject
 

Public Member Functions

static int ailiaCreateDetector (ref IntPtr detector, IntPtr net, UInt32 format, UInt32 channel, UInt32 range, UInt32 algorithm, UInt32 category_count, UInt32 flags)
 
static void ailiaDestroyDetector (IntPtr detector)
 Destroy the detector object. More...
 
static int ailiaDetectorCompute (IntPtr detector, IntPtr src, UInt32 src_stride, UInt32 src_width, UInt32 src_height, UInt32 src_format, float threshold, float iou)
 Perform object recognition. More...
 
static int ailiaDetectorGetObjectCount (IntPtr detector, ref UInt32 obj_count)
 Get the number of recognition results. More...
 
static int ailiaDetectorGetObject (IntPtr detector, [In, Out] AILIADetectorObject obj, UInt32 obj_idx, UInt32 version)
 Get the recognition result. More...
 
static int ailiaDetectorSetAnchors (IntPtr detector, float [] anchors, UInt32 anchors_count)
 Set anchors or biases information for YoloV2 etc. More...
 
static int ailiaDetectorSetInputShape (IntPtr detector, UInt32 input_width, UInt32 input_height)
 Specifies the input image size to the model in YoloV3. More...
 

Public Attributes

const Int32 AILIA_DETECTOR_OBJECT_VERSION = (1)
 
const Int32 AILIA_DETECTOR_ALGORITHM_YOLOV1 = (0)
 
const Int32 AILIA_DETECTOR_ALGORITHM_YOLOV2 = (1)
 
const Int32 AILIA_DETECTOR_ALGORITHM_YOLOV3 = (2)
 
const Int32 AILIA_DETECTOR_ALGORITHM_YOLOV4 = (3)
 
const Int32 AILIA_DETECTOR_ALGORITHM_YOLOX = (4)
 
const Int32 AILIA_DETECTOR_ALGORITHM_SSD = (8)
 
const Int32 AILIA_DETECTOR_FLAG_NORMAL = (0)
 

Member Function Documentation

◆ ailiaCreateDetector()

static int AiliaDetector.ailiaCreateDetector ( ref IntPtr  detector,
IntPtr  net,
UInt32  format,
UInt32  channel,
UInt32  range,
UInt32  algorithm,
UInt32  category_count,
UInt32  flags 
)

◆ ailiaDestroyDetector()

static void AiliaDetector.ailiaDestroyDetector ( IntPtr  detector)

Destroy the detector object.

Parameters
detectorDetection object pointer

◆ ailiaDetectorCompute()

static int AiliaDetector.ailiaDetectorCompute ( IntPtr  detector,
IntPtr  src,
UInt32  src_stride,
UInt32  src_width,
UInt32  src_height,
UInt32  src_format,
float  threshold,
float  iou 
)

Perform object recognition.

Parameters
detectorDetection object pointer
srcImage data (32bpp)
src_strideByte count of one line
src_widthImage width
src_heightImage height
src_formatImage format (AILIA_IMAGE_FORMAT_*)
thresholdDetection threshold (e.g. 0.1f) (the smaller the threshold, the more likely it is to be detected and the more detections will be made)
iouDuplicate exclusion threshold (e.g. 0.45f) (the smaller the threshold is, the less duplicates are allowed and the fewer the number of detections)
Returns
If successful, return AILIA_STATUS_SUCCESS, otherwise return error code.

◆ ailiaDetectorGetObject()

static int AiliaDetector.ailiaDetectorGetObject ( IntPtr  detector,
[In, Out] AILIADetectorObject  obj,
UInt32  obj_idx,
UInt32  version 
)

Get the recognition result.

Parameters
detectorDetection object pointer
objobject information
obj_idxobject index
versionAILIA_DETECTOR_OBJECT_VERSION
Returns
Returns AILIA_STATUS_SUCCESS if successful, otherwise returns error code.

If ailiaPredict() has never been executed, then return * AILIA_STATUS_INVALID_STATE. Recognition results are sorted in order of probability.

◆ ailiaDetectorGetObjectCount()

static int AiliaDetector.ailiaDetectorGetObjectCount ( IntPtr  detector,
ref UInt32  obj_count 
)

Get the number of recognition results.

Parameters
detectorDetection object pointer
obj_countNumber of objects
Returns
If successful, return AILIA_STATUS_SUCCESS, otherwise return error code.

◆ ailiaDetectorSetAnchors()

static int AiliaDetector.ailiaDetectorSetAnchors ( IntPtr  detector,
float []  anchors,
UInt32  anchors_count 
)

Set anchors or biases information for YoloV2 etc.

Parameters
detectorDetection object pointer
anchorsDimensions of anchors (possible shape, height and width of detection box)
anchors_countnumber of anchors (half of the array size of anchors)
Returns
Return AILIA_STATUS_SUCCESS if successful, otherwise return error code.

YoloV2, for example, tries multiple forms of the default detection box at the same time. This data describes the plural form of the box. anchors is stored in the form {x,y,x,y...} The anchors are stored in the form {x,y,x,y...}. If anchors_count is 5, then anchors is a 10-dimensional array.

◆ ailiaDetectorSetInputShape()

static int AiliaDetector.ailiaDetectorSetInputShape ( IntPtr  detector,
UInt32  input_width,
UInt32  input_height 
)

Specifies the input image size to the model in YoloV3.

Parameters
detectorDetection object pointer
input_widthInput image width for the model
input_heightInput image height of the model
Returns
Returns AILIA_STATUS_SUCCESS if successful, otherwise returns an error code.

YoloV3 allows a single model to correspond to any input resolution. (with a multiple limit of 32) Execute this API if you want to specify the input image size for a model, e.g. to reduce computation time. This API must be executed between ailiaCreateDetector() and ailiaDetectorCompute(). If this API is not executed, the default value of 416x416 is used. If executed outside of YOLOv3, it returns AILIA_STATUS_INVALID_STATE.

Member Data Documentation

◆ AILIA_DETECTOR_ALGORITHM_SSD

const Int32 AiliaDetector.AILIA_DETECTOR_ALGORITHM_SSD = (8)

SSD

◆ AILIA_DETECTOR_ALGORITHM_YOLOV1

const Int32 AiliaDetector.AILIA_DETECTOR_ALGORITHM_YOLOV1 = (0)

YOLOV1

◆ AILIA_DETECTOR_ALGORITHM_YOLOV2

const Int32 AiliaDetector.AILIA_DETECTOR_ALGORITHM_YOLOV2 = (1)

YOLOV2

◆ AILIA_DETECTOR_ALGORITHM_YOLOV3

const Int32 AiliaDetector.AILIA_DETECTOR_ALGORITHM_YOLOV3 = (2)

YOLOV3

◆ AILIA_DETECTOR_ALGORITHM_YOLOV4

const Int32 AiliaDetector.AILIA_DETECTOR_ALGORITHM_YOLOV4 = (3)

YOLOV4

◆ AILIA_DETECTOR_ALGORITHM_YOLOX

const Int32 AiliaDetector.AILIA_DETECTOR_ALGORITHM_YOLOX = (4)

YOLOX

◆ AILIA_DETECTOR_FLAG_NORMAL

const Int32 AiliaDetector.AILIA_DETECTOR_FLAG_NORMAL = (0)

No options

◆ AILIA_DETECTOR_OBJECT_VERSION

const Int32 AiliaDetector.AILIA_DETECTOR_OBJECT_VERSION = (1)

The documentation for this class was generated from the following file: