vitis::ai::Rcan - 3.5 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2023-06-29
Version
3.5 English
Base class for detecting rcan from an image (cv::Mat).

Input is an image (cv::Mat).

Output is the enlarged image.

Sample code:

Note: The input image size is 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::Rcan::create(argv[1]);
Mat ret_img = det->run(input_img).feat;
imwrite("sample_rcan_result.png", ret_img);

Display of the model results:

Figure 1. result image
result image

Quick Function Reference

The following table lists all the functions defined in the vitis::ai::Rcan class:

Table 1. Quick Function Reference
Type Member Arguments
std::unique_ptr< Rcan > create
  • const std::string & model_name
  • bool need_preprocess
RcanResult run
  • const cv::Mat & image
std::vector< RcanResult > run
  • const std::vector< cv::Mat > & images
std::vector< RcanResult > run
  • const std::vector< vart::xrt_bo_t > & input_bos