The C++ deployment example requires specific system dependencies and NVIDIA libraries.
1. Install System Dependencies
apt-get update
apt-get install libyaml-cpp-dev libopencv-dev python3-opencv
2. Prerequisites
Ensure you have installed:
3. Build Process
Navigate to deploy/cpp and create a build directory. You can build using the system's TensorRT or a specific TensorRT installation from a tar package.
Build with system TensorRT:
cmake .. && make
Build with a specific TensorRT path:
cmake -DTENSORRT_ROOT=<path_to_tensorrt> .. && make
Build with specific TensorRT path and CUDA architecture:
cmake -DTENSORRT_ROOT=<path_to_tensorrt> -DCMAKE_CUDA_ARCHITECTURES=<your_cuda_architecture> .. && make
4. Running Inference
Once built, run the ./main executable with the following arguments:
./main <cfg_path> <engine_path> <left_image_path> <right_image_path> <options>
Note: If using a TensorRT tar package, ensure LD_LIBRARY_PATH is correctly set. You can verify the links using ldd main | grep libnv*.
cd deploy/cpp
mkdir build && cd build
cmake -DTENSORRT_ROOT=/path/to/tensorrt -DCMAKE_CUDA_ARCHITECTURES=86 .. && make
./main config.yaml model.engine left.png right.png