vitis::ai::TFSSD - 3.5 日本語

Vitis AI ライブラリ ユーザー ガイド (UG1354)

Document ID
UG1354
Release Date
2023-06-29
Version
3.5 日本語
COCO データセットの 90 個のオブジェクトを検出するためのベース クラス。

入力はイメージ (cv:Mat) です。

出力は TFSSDResult という名前の検出結果の構造体です。

サンプル コード:

  Mat img = cv::imread("sample_tfssd.jpg");
  auto tfssd = vitis::ai::TFSSD::create("ssd_resnet_50_fpn_coco_tf",true);
  auto results = tfssd->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 height = 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. 検出結果
detection result

関数クイック リファレンス

次の表に、vitis::ai::TFSSD クラスに定義されているすべての関数を示します。

表 1. 関数クイック リファレンス
タイプ メンバー 引数
std::unique_ptr< TFSSD > create
  • const std::string & model_name
  • bool need_preprocess
vitis::ai::TFSSDResult run
  • const cv::Mat & img
std::vector< vitis::ai::TFSSDResult > run
  • const std::vector< cv::Mat > & imgs
int getInputWidth
  • void
int getInputHeight
  • void
size_t get_input_batch
  • void