Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.04 KB

README.md

File metadata and controls

25 lines (19 loc) · 1.04 KB

TensorRT inference

This directory contains C++ code to run an exported MGNet model with TensorRT optimized performance. Please follow ONNX/TensorRT Export on how to export pretrained models.

Note, that the code is tailored for Cityscapes models. To deploy models trained on other datasets, adapt the Code in main.cpp. The code comments will guide you on what needs to be updated.

Build

To build the TensorRT code, make sure TensorRT and libtorch is installed and run

mkdir build
cd build
cmake ..
make -j

If you followed the Local Installation guide, you have to update CMakeLists.txt to use the correct path for find_package(Torch).

Run

To run inference, call

./trt_inference /path/to/model_plan_file /path/to/postprocessing_pt_file /path/to/image_file /path/to/calibration_file

Note, that the calibration file should be in Cityscapes format and contain at least the intrinsic parameters and the extrinsic z component.