Build
Configuring CMakeLists
CMakeLists is used to set the target file of the post-processing dynamic library and link related third-party libraries. Each post-processing dynamic library corresponds to a CMakeLists.txt file. For the post-processing CMakeLists.txt file, you need to modify the post-processing name and the target file for generating the dynamic library, and retain other original configurations. The following uses ResNet-50 post-processing as an example. For details about CMakeLists.txt, see CMakeLists.
In the preceding code, resnet50postprocessor and ResNet50PostProcessor.cpp indicate the name of the post-processing dynamic library and the target file of post-processing respectively. Other configuration items are the same as those of the original postprocessing dynamic library.
CLI Compilation
The CLI compilation is used to compile and generate the plugin based on the configuration of the CMakeLists.txt file.
- Create a ResNet50PostProcessor directory.
cd {sdk_install_path}/samples/ mkdir ResNet50PostProcessor
{sdk_install_path} indicates the installation path of the MindX SDK.
- Go to the ResNet50PostProcessor directory.
cd ResNet50PostProcessor
- Save the post-processing dynamic library header file, source file, and CMakeLists.txt file (see Post-processing Code of the Model Sample in the Old Framework) to the ResNet50PostProcessor directory.
- Create a build folder and go to the build folder.
mkdir build cd build
- Create the Makefile to avoid polluting the CMakeLists file of the project.
cmake ..
- Build the project based on the generated Makefile file.
make -j
- Copy the .so file of the generated postprocessing to the lib directory.
make install