How to Using the AI Library's Post-Processing Library - 1.1 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2020-03-23
Version
1.1 English

Post-processing is an important step in the whole process. Each neural network has different post-processing methods. The xnnpp post-processing library is provided in AI Library to facilitate user calls. It is a closed source library. It supports the following neural network post-processing.

  • Classification
  • Face detection
  • Face landmark detection
  • SSD detection
  • Pose detection
  • Semantic segmentation
  • Road line detection
  • YOLOV3 detection
  • YOLOV2 detection
  • Openpose detection
  • RefineDet detection
  • ReId detection
  • Multi-task

There are two ways to call xnnpp.

  • One is automatic call, through vitis::ai::<model>::create create the task, such as vitis::ai::YOLOv3::create("yolov3_bdd", true). After <model>->run finished, xnnpp will be automatically processed, users can modify the parameters through the model configuration file.
  • One is manual call, through vitis::ai::DpuTask::create to create the task. Then, create the object of the post-process and run the post-process. Take SSD post-processing as an example, the specific steps are as follows.
    1. Create a config and set the correlating data to control post-process.
      using DPU_conf = vitis::ai::proto::DpuModelParam;
      DPU_conf config;
    2. If it is a caffemodel, set the "is_tf" false.
      config.set_is_tf(false);
    3. Fill other parameters.
      fillconfig(config);
    4. Create an object of SSDPostProcess.
      auto input_tensor = task->getInputTensor();
      auto output_tensor = task->getOutputTensor();
      auto ssd = vitis::ai::SSDPostProcess::create(input_tensor, output_tensor,config);
    5. Run the post-process.
      auto results = ssd->ssd_post_process();
Note: For more details about the post processing examples, see the ~/vitis-ai/vitis_ai_library/overview/demo/yolov3/demo_yolov3.cpp and ~/vitis-ai/vitis_ai_library/yolov3/test/test_yolov3.cpp in the host syetem.