vitis::ai::YOLOvX - 2.5 日本語

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

Document ID
UG1354
Release Date
2022-06-15
Version
2.5 日本語
入力イメージ (cv::Mat) 内の物体を検出するためのベース クラス。

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

出力は、入力イメージ内の歩行者の位置です。

サンプル コード:

auto yolo = vitis::ai::YOLOvX::create("yolovx_pt", true);

Mat img = cv::imread("sample_yolovx.jpg");
auto results = yolo->run(img);

for (auto& result : results.bboxes) {
  int label = result.label;
  auto& box = result.box;

  cout << "RESULT: " << label << "\t" << std::fixed << std::setprecision(2)
       << box[0] << "\t" << box[1] << "\t" << box[2] << "\t" << box[3] << "\t"
       << std::setprecision(6) << result.score << "\n";
  rectangle(img, Point(box[0], box[1]), Point(box[2], box[3]),
            Scalar(0, 255, 0), 1, 1, 0);
}
imwrite("result.jpg", img);

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

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

表 1. 関数クイック リファレンス
タイプ メンバー 引数
std::unique_ptr< YOLOvX > create
  • const std::string & model_name
  • bool need_preprocess
std::unique_ptr< YOLOvX > create
  • const std::string & model_name
  • xir::Attrs * attrs
  • bool need_preprocess
YOLOvXResult run
  • const cv::Mat & image
std::vector< YOLOvXResult > run
  • const std::vector< cv::Mat > & images