ailia  1.3.0.0
ailia_detector.h
Go to the documentation of this file.
1 
14 #if !defined(INCLUDED_AILIA_DETECTOR)
15 #define INCLUDED_AILIA_DETECTOR
16 
17 /* コアライブラリ */
18 
19 #include "ailia.h"
20 #include "ailia_format.h"
21 
22 /* 呼び出し規約 */
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /****************************************************************
29  * 検出オブジェクトのインスタンス
30  **/
31 
32 struct AILIADetector;
33 
34 /****************************************************************
35  * 物体情報
36  **/
37 #define AILIA_DETECTOR_OBJECT_VERSION (1)
38 
39 typedef struct _AILIADetectorObject {
47  unsigned int category;
55  float prob;
63  float x;
71  float y;
79  float w;
87  float h;
89 
90 #define AILIA_DETECTOR_ALGORITHM_YOLOV1 (0) // YOLOV1
91 #define AILIA_DETECTOR_ALGORITHM_YOLOV2 (1) // YOLOV2
92 #define AILIA_DETECTOR_ALGORITHM_YOLOV3 (2) // YOLOV3
93 #define AILIA_DETECTOR_ALGORITHM_YOLOV4 (3) // YOLOV4
94 #define AILIA_DETECTOR_ALGORITHM_YOLOX (4) // YOLOX
95 #define AILIA_DETECTOR_ALGORITHM_SSD (8) // SSD(Single Shot multibox Detector)
96 
97 #define AILIA_DETECTOR_FLAG_NORMAL (0) // オプションなし
98 
99 /****************************************************************
100  * 物体検出API
101  **/
102 
130 int AILIA_API ailiaCreateDetector(struct AILIADetector** detector, struct AILIANetwork* net, unsigned int format, unsigned int channel, unsigned int range, unsigned int algorithm, unsigned int category_count, unsigned int flags);
131 
141 void AILIA_API ailiaDestroyDetector(struct AILIADetector* detector);
142 
172 int AILIA_API ailiaDetectorCompute(struct AILIADetector* detector, const void* src, unsigned int src_stride, unsigned int src_width, unsigned int src_height, unsigned int src_format, float threshold, float iou);
173 
189 int AILIA_API ailiaDetectorGetObjectCount(struct AILIADetector* detector, unsigned int* obj_count);
190 
216 int AILIA_API ailiaDetectorGetObject(struct AILIADetector* detector, AILIADetectorObject* obj, unsigned int obj_idx, unsigned int version);
217 
244 int AILIA_API ailiaDetectorSetAnchors(struct AILIADetector* detector, float* anchors, unsigned int anchors_count);
245 
278 int AILIA_API ailiaDetectorSetInputShape(struct AILIADetector* detector, unsigned int input_width, unsigned int input_height);
279 
280 #ifdef __cplusplus
281 }
282 #endif
283 #endif /* !defined(INCLUDED_AILIA_DETECTOR) */
struct _AILIADetectorObject AILIADetectorObject
unsigned int category
Definition: ailia_detector.h:47
float x
Definition: ailia_detector.h:63
float y
Definition: ailia_detector.h:71
int AILIA_API ailiaDetectorCompute(struct AILIADetector *detector, const void *src, unsigned int src_stride, unsigned int src_width, unsigned int src_height, unsigned int src_format, float threshold, float iou)
Performs object detection.
float w
Definition: ailia_detector.h:79
void AILIA_API ailiaDestroyDetector(struct AILIADetector *detector)
Destroys the detector instance.
float h
Definition: ailia_detector.h:87
int AILIA_API ailiaCreateDetector(struct AILIADetector **detector, struct AILIANetwork *net, unsigned int format, unsigned int channel, unsigned int range, unsigned int algorithm, unsigned int category_count, unsigned int flags)
Creates a detector instance.
int AILIA_API ailiaDetectorGetObjectCount(struct AILIADetector *detector, unsigned int *obj_count)
Gets the number of detection results.
inference library
float prob
Definition: ailia_detector.h:55
int AILIA_API ailiaDetectorSetInputShape(struct AILIADetector *detector, unsigned int input_width, unsigned int input_height)
Sets the size of the input image for YoloV3 or YoloX model.
#define AILIA_API
Definition: ailia.h:27
int AILIA_API ailiaDetectorGetObject(struct AILIADetector *detector, AILIADetectorObject *obj, unsigned int obj_idx, unsigned int version)
Gets the detection results.
Definition: ailia_detector.h:39
AILIA format definition and conversion.
int AILIA_API ailiaDetectorSetAnchors(struct AILIADetector *detector, float *anchors, unsigned int anchors_count)
Sets the anchor information (anchors or biases) for YoloV2 or other systems.