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

Vitis AI Library User Guide (UG1354)

Document ID
Release Date
3.5 English

Each neural network has different post-processing methods. The xnnpp post-processing library is provided in the Vitis AI Library to facilitate user calls. 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
  • Multi-task V3
  • Face recognition
  • Plate detection
  • Plate recognition
  • Medical segmentation
  • Medical detection
  • Face quality
  • Hourglass
  • Retinaface
  • Centerpoint
  • Multitaskv3
  • Pointpillars_nuscenes
  • Rcan
  • vehicleclassification
  • ofa_yolo
  • efficientdet_d2
  • ocr
  • textmountain
  • YOLOx detection
  • YOLOv6 detection

There are two ways to call xnnpp:

  • Using an automatic call through vitis::ai::<model>::create to create the task such as vitis::ai::YOLOv3::create("yolov3_bdd", true). After the <model> run is complete, xnnpp is automatically processed. You can modify the parameters through the model configuration file.
  • Using 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. Use the following steps. SSD post-processing is used as an example here.
    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 Caffe model, set the "is_tf" as FALSE.
    3. Fill the other parameters.
    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/examples/vai_library/samples/dpu_task/yolov3/demo_yolov3.cpp and ~/Vitis-AI/src/vai_library/yolov3/test/test_yolov3.cpp files in the host system.