Skip to content

Integrate

Environment Setting

  • Development is carried out through Visual Studio.
  • To utilize DLLs for development, you need to configure the related settings according to the following guide.

1. Visual Studio

Dll File Name Task Configuration
Inspection.dll Inspection Release x64
Inspection_d.dll Inspection Debug x64
  • Specify the Configuration based on the table above.

  • Using Visual Studio 2022 is recommended

    • Execution method for different versions of Visual Studio

      • including an example for Visual Studio 2017

      1) Project Properties - Configuration Properties - General - General - Change Window SDK Version

      • ex) 10.0.17763.0

      2) Project Properties - Configuration Properties - General - Project Defaults - Change Platform Toolset to the desired version

      • ex) Visual Studio 2017 (v141)
    • If there's a failure to load the DLL

      • Project Properties - Configuration Properties - Debugging - Environment, check the DLL path
      • ex) PATH=$(TargetDir)......\dll;$(ProjectDir)....\dll;%PATH%

2. Dependency

  • Dependency information required for integration

  • dll

    • Project Properties - Configuration Properties - Debugging - Environment
      • Add "PATH={Inspection.dll directory path};%PATH%"
      • ex) PATH=$(TargetDir)dll;%PATH%
  • lib

    • Project Properties - Linker - Input - Additional Dependencies
      • Add "Inspection.lib"
    • Project Properties - Linker - General - Additional Library Directories
      • Add directory path containing Inspection.lib
      • ex) $(TargetDir)lib
  • header

    • Project Properties - C/C++ - General - Additional Include Directories
      • Add directory path containing header files
      • ex) $(TargetDir)include

3. Install Library

  • The list of libraries being used

    1. spdlog_native - 2021.7.30 ver
    2. nolhmann.json - 3.11.2 ver
    3. opencv - 4.2 ver
    4. Microsoft.ML.OnnxRuntime.Gpu
    CUDA ONNX Runtime cuDNN
    11.8 1.15 ~ 1.16 8.2.4 (Linux)
    8.5.0.96 (Windows)
    11.6 1.13 ~ 1.14 8.2.4 (Linux)
    8.5.0.96 (Windows)
    11.x 1.7 ~ 1.12 8.0.4 ~ 8.2.4 (Linux)
    8.0.2.39 ~ 8.2.2.26 (Windows)
    10.1 1.2 ~ 1.4 7.6.5
    10.0 1.0 ~ 1.1 7.6.4
    • reference: https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html
    • Install according to the CUDA version, referencing the table above or the website
  • Recommended Installation Method:

    • Install libraries via NuGet Package Manager.
    • Tools - NuGet Package Manager - Manage NuGet Packages for Solution
      • Install Microsoft.ML.OnnxRuntime.Gpu
        • Referencing the table on the above site, install according to the CUDA version.
      • Install spdlog_native(by yuxchen) version 2021.7.30
      • Install nolhmann.json 3.11.2
      • Install opencv4.2

4. Installation Check

  • Development environment setup is complete if there are no errors during the build
  • CellType may vary for each client, and can be checked for types in type.h
#include "api.h"

int main()
{
    string onnxPath = "path/to/onnxFile.onnx";
    ModelConfig mc = CreateModelConfig(
        "0",
        onnxPath,
        CellType::CYLINDER_CIRCLE_2170 // CellType may vary for each client
    );
    Inspector* inspector = CreateInspector(mc);

    DeleteInspector(inspector);
}