COCO データセットの 90 個のオブジェクトを検出するためのベース クラス。
入力はイメージ (cv:Mat)。
出力は、MedicalSegmentationResult
という名前の検出結果の構造体です。
サンプル コード:
Mat img = cv::imread("sample_medicalsegmentation.jpg");
auto medicalsegmentation = vitis::ai::MedicalSegmentation::create("ssd_resnet_50_fpn_coco_tf",true);
auto results = medicalsegmentation->run(img);
for(const auto &r : results.bboxes){
auto label = r.label;
auto x = r.x * img.cols;
auto y = r.y * img.rows;
auto width = r.width * img.cols;
auto heigth = r.height * img.rows;
auto score = r.score;
std::cout << "RESULT: " << label << "\t" << x << "\t" << y << "\t" <<
width
<< "\t" << height << "\t" << score << std::endl;
}
モデル結果を次に表示します。
図 1. 検出結果

関数クイック リファレンス
次の表に、vitis::ai::MedicalSegmentation
クラスに定義されているすべての関数を示します。
タイプ | 名前 | 引数 |
---|---|---|
std::unique_ptr< MedicalSegmentation > |
create |
|
vitis::ai::MedicalSegmentationResult
|
run |
|
std::vector< vitis::ai::MedicalSegmentationResult > |
run |
|
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|