vitis::ai::Segmentation8UC3 - 1.4.1 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2021-12-11
Version
1.4.1 English
The Class of Segmentation8UC3, this class run function run(const cv::Mat& image) return a cv::Mat with the type is cv_8UC3 Sample code :
   auto det =
vitis::ai::Segmentation8UC3::create(vitis::ai::SEGMENTATION_FPN);
  auto img = cv::imread("sample_segmentation.jpg");

   int width = det->getInputWidth();
   int height = det->getInputHeight();
   cv::Mat image;
   cv::resize(img, image, cv::Size(width, height), 0, 0,
              cv::INTER_LINEAR);
   auto result = det->run(image);
   cv::imwrite("segres.jpg",result.segmentation);

Quick Function Reference

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

Table 1. Quick Function Reference
Type Name Arguments
std::unique_ptr< Segmentation8UC3 > create
  • const std::string & model_name
  • bool need_preprocess
int getInputWidth
  • void
int getInputHeight
  • void
size_t get_input_batch
  • void
SegmentationResult run
  • const cv::Mat & image
std::vector< SegmentationResult > run
  • const std::vector< cv::Mat > & images