vitis::ai::Solo - 2.5 简体中文

Vitis AI Library 用户指南 (UG1354)

Document ID
UG1354
Release Date
2022-06-15
Version
2.5 简体中文
此基本类对应来自图像 (cv::Mat) 的 SOLO 语义分割。

输入为图像 (cv::Mat)。

输出为放大的图像。

代码样本:

注释: 输入图像大小为 640x360
if (argc < 2) {
  cerr << "usage: " << argv[0] << "  modelname  image_file_url " << endl;
  abort();
}
Mat input_img = imread(argv[2]);
if (input_img.empty()) {
  cerr << "can't load image! " << argv[2] << endl;
  return -1;
}
auto det = vitis::ai::Solo::create(argv[1]);
Mat ret_img = det->run(input_img).feat;
imwrite("sample_solo_result.png", ret_img);

函数快速参考

下表列出了 vitis::ai::Solo 类中定义的所有函数:

表 1. 函数快速参考
类型 成员 实参
std::unique_ptr< Solo > create
  • const std::string & model_name
  • bool need_preprocess
SoloResult run
  • const cv::Mat & image
std::vector< SoloResult > run
  • const std::vector< cv::Mat > & images