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 asvitis::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.- Create a config and set the correlating data to control
post-process.
using DPU_conf = vitis::ai::proto::DpuModelParam; DPU_conf config;
- If it is a caffemodel, set the "is_tf"
false.
config.set_is_tf(false);
- Fill other
parameters.
fillconfig(config);
- 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);
- Run the
post-process.
auto results = ssd->ssd_post_process();
- Create a config and set the correlating data to control
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.