vitis::ai::UltraFast - 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 traffic lane for CULane dataset.

Input is an image (cv:Mat).

Output is a struct of detection results, named UltraFastResult .

Sample code :

Mat img = cv::imread("sample_ultrafast.jpg");
auto ultrafast = vitis::ai::UltraFast::create("ultrafast_pt",true);
auto results = ultrafast->run(img);
for(const auto &lanes : results.lanes){
  std::cout <<"lane:\n";
  for(auto &v: lanes) {
     std::cout << "    ( " << v.first << ", " << v.second << " )\n";
  }
}

Display of the model results:

Figure 1. detection result
detection result

Quick Function Reference

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

Table 1. Quick Function Reference
Type Member Arguments
std::unique_ptr< UltraFast > create
  • const std::string & model_name
  • bool need_preprocess
vitis::ai::UltraFastResult run
  • const cv::Mat & img
std::vector< vitis::ai::UltraFastResult > run
  • const std::vector< cv::Mat > & imgs
int getInputWidth
  • void
int getInputHeight
  • void
size_t get_input_batch
  • void