Build

Configuring CMakeLists.txt

This file is used to set the target file for generating the postprocessing dynamic library, and link-related third-party libraries. Each postprocessing has a corresponding CMakeLists.txt file. For the new postprocessing CMakeLists.txt file, you only need to modify the name of the generated postprocessing and the target file of the generated dynamic library, and use other original configuration items. The following describes how to develop a ResNet-50 post-processing. (For details about the configuration example, see CMakeLists (CMakeLists.txt).)

In the code, samplepostprocess and SamplePostProcess.cpp indicate the name of the postprocessing dynamic library and the target file of postprocessing respectively. Other configuration items remain unchanged.

CLI Compilation

The CLI compilation is used to compile and generate the plugin based on the configuration of the CMakeLists.txt file. In the following steps, {sdk_install_path} indicates the installation path of the MindX SDK.

  1. Create a SamplePostProcess directory and access the directory.
    cd {sdk_install_path}/samples/
    mkdir SamplePostProcess
    cd SamplePostProcess
  2. Save the post-processing dynamic library header file, source file, and CMakeLists.txt file (see Post-processing Code of the Model Sample in the New Framework) to the SamplePostProcess directory.
  3. Create a build directory and access the directory.
    mkdir build
    cd build
  4. Create the Makefile to avoid polluting the CMakeLists file of the project.
    cmake ..
  5. Build the project based on the generated Makefile file.
    make -j
  6. Copy the .so file of the generated postprocessing to the {sdk_install_path}/lib/modelpostprocessors directory.
    make install