Using the AI Library's Post-Processing Library - 1.4.1 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2021-12-11
Version
1.4.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 Vitis 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
  • Face recognition
  • Plate detection
  • Plate recognition
  • Medical segmentation
  • Medical detection
  • Face quality
  • Hourglass
  • Retinaface
  • Centerpoint
  • Multitaskv3
  • Pointpillars_nuscenes
  • Rcan

There are two ways to call xnnpp:

  • One is an automatic call, through vitis::ai::<model>::create, to create the task, such as vitis::ai::YOLOv3::create("yolov3_bdd", true). After <model>->run finished, xnnpp is automatically processed. You can modify the parameters through the model configuration file.
  • One is a 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 configuration 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" as false.
      config.set_is_tf(false);
    3. Fill the 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/demo/Vitis-AI-Library/samples/dpu_task/yolov3/demo_yolov3.cpp and ~/Vitis-AI/tools/Vitis-AI-Library/yolov3/test/test_yolov3.cpp files in the host system.