|
ailia
1.6.0.0
|
AILIA 物体検出ライブラリ [詳解]

クラス | |
| struct | _AILIADetectorObject |
マクロ定義 | |
| #define | AILIA_DETECTOR_OBJECT_VERSION (1) |
| #define | AILIA_DETECTOR_ALGORITHM_YOLOV1 (0) |
| #define | AILIA_DETECTOR_ALGORITHM_YOLOV2 (1) |
| #define | AILIA_DETECTOR_ALGORITHM_YOLOV3 (2) |
| #define | AILIA_DETECTOR_ALGORITHM_YOLOV4 (3) |
| #define | AILIA_DETECTOR_ALGORITHM_YOLOX (4) |
| #define | AILIA_DETECTOR_ALGORITHM_SSD (8) |
| #define | AILIA_DETECTOR_FLAG_NORMAL (0) |
型定義 | |
| typedef struct _AILIADetectorObject | AILIADetectorObject |
関数 | |
| 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) |
| 検出オブジェクトを作成します。 [詳解] | |
| void AILIA_API | ailiaDestroyDetector (struct AILIADetector *detector) |
| 検出オブジェクトを破棄します。 [詳解] | |
| 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) |
| 物体検出を行います。 [詳解] | |
| int AILIA_API | ailiaDetectorGetObjectCount (struct AILIADetector *detector, unsigned int *obj_count) |
| 検出結果の数を取得します。 [詳解] | |
| int AILIA_API | ailiaDetectorGetObject (struct AILIADetector *detector, AILIADetectorObject *obj, unsigned int obj_idx, unsigned int version) |
| 検出結果を取得します。 [詳解] | |
| int AILIA_API | ailiaDetectorSetAnchors (struct AILIADetector *detector, float *anchors, unsigned int anchors_count) |
| YoloV2などのためにアンカーズ (anchorsまたはbiases) の情報を設定します。 [詳解] | |
| int AILIA_API | ailiaDetectorSetInputShape (struct AILIADetector *detector, unsigned int input_width, unsigned int input_height) |
| YoloV3またはYoloXでのモデルへの入力画像サイズを指定します。 [詳解] | |
AILIA 物体検出ライブラリ
| #define AILIA_DETECTOR_ALGORITHM_SSD (8) |
| #define AILIA_DETECTOR_ALGORITHM_YOLOV1 (0) |
| #define AILIA_DETECTOR_ALGORITHM_YOLOV2 (1) |
| #define AILIA_DETECTOR_ALGORITHM_YOLOV3 (2) |
| #define AILIA_DETECTOR_ALGORITHM_YOLOV4 (3) |
| #define AILIA_DETECTOR_ALGORITHM_YOLOX (4) |
| #define AILIA_DETECTOR_FLAG_NORMAL (0) |
| #define AILIA_DETECTOR_OBJECT_VERSION (1) |
| typedef struct _AILIADetectorObject AILIADetectorObject |
| 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 | ||
| ) |
検出オブジェクトを作成します。
| detector | 検出オブジェクトポインタ |
| net | ネットワークオブジェクトポインタ |
| format | ネットワークの画像フォーマット (AILIA_NETWORK_IMAGE_FORMAT_*) |
| channel | ネットワークの画像チャンネル (AILIA_NETWORK_IMAGE_CHANNEL_*) |
| range | ネットワークの画像レンジ (AILIA_NETWORK_IMAGE_RANGE_*) |
| algorithm | 検出アルゴリズム(AILIA_DETECTOR_ALGORITHM_*) |
| category_count | 検出カテゴリ数(VOCの場合は20、COCOの場合は80、などを指定) |
| flags | 追加オプションフラグ(AILIA_DETECTOR_FLAG_*) |
| void AILIA_API ailiaDestroyDetector | ( | struct AILIADetector * | detector | ) |
検出オブジェクトを破棄します。
| detector | 検出オブジェクトポインタ |
| 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 | ||
| ) |
物体検出を行います。
| detector | 検出オブジェクトポインタ |
| src | 画像データ(32bpp) |
| src_stride | 1ラインのバイト数 |
| src_width | 画像幅 |
| src_height | 画像高さ |
| src_format | 画像フォーマット (AILIA_IMAGE_FORMAT_*) |
| threshold | 検出しきい値(0.1f等)(小さいほど検出されやすくなり、検出数増加) |
| iou | 重複除外しきい値(0.45f等)(小さいほど重複を許容せず検出数減少) |
| int AILIA_API ailiaDetectorGetObject | ( | struct AILIADetector * | detector, |
| AILIADetectorObject * | obj, | ||
| unsigned int | obj_idx, | ||
| unsigned int | version | ||
| ) |
検出結果を取得します。
| detector | 検出オブジェクトポインタ |
| obj | オブジェクト情報 |
| obj_idx | オブジェクトインデックス |
| version | AILIA_DETECTOR_OBJECT_VERSION |
ailiaDetectorCompute() を一度も実行していない場合は AILIA_STATUS_INVALID_STATE が返ります。 検出結果は推定確率順でソートされます。
| int AILIA_API ailiaDetectorGetObjectCount | ( | struct AILIADetector * | detector, |
| unsigned int * | obj_count | ||
| ) |
検出結果の数を取得します。
| detector | 検出オブジェクトポインタ |
| obj_count | オブジェクト数 |
| int AILIA_API ailiaDetectorSetAnchors | ( | struct AILIADetector * | detector, |
| float * | anchors, | ||
| unsigned int | anchors_count | ||
| ) |
YoloV2などのためにアンカーズ (anchorsまたはbiases) の情報を設定します。
| detector | 検出オブジェクトポインタ |
| anchors | アンカーズの寸法 (検出ボックスの形状、高さと幅) |
| anchors_count | アンカーズの数 (anchorsの配列サイズの半分) |
YoloV2などは学習時に決定された複数の検出ボックスを使用して物体検出を行います。このAPIで学習時に決定された検出ボックスの形状を設定することで、正しい推論を行います。 anchorsには{x,y,x,y...}の形式で格納します。 anchors_countが5の場合、anchorsは10次元の配列になります。
| int AILIA_API ailiaDetectorSetInputShape | ( | struct AILIADetector * | detector, |
| unsigned int | input_width, | ||
| unsigned int | input_height | ||
| ) |
YoloV3またはYoloXでのモデルへの入力画像サイズを指定します。
| detector | 検出オブジェクトポインタ |
| input_width | モデルの入力画像幅 |
| input_height | モデルの入力画像高さ |
YoloV3では単一のモデルが任意の入力解像度に対応します。(32 の倍数制限あり) YoloXでは単一のモデルが任意の入力解像度に対応します。 計算量の削減等でモデルへの入力画像サイズを指定する場合この API を実行してください。 ailiaCreateDetector() () と ailiaDetectorCompute() () の間に実行する必要があります。 この API を実行しない場合、デフォルトの 416x416 を利用します。 YOLOv3またはYOLOX 以外で実行した場合、 AILIA_STATUS_INVALID_STATE を返します。