Sample projects for TensorRT in C++
./main [input]
- input = blank
- use the default image file set in source code (main.cpp)
- e.g. ./main
- input = *.mp4, *.avi, *.webm
- use video file
- e.g. ./main test.mp4
- input = *.jpg, *.png, *.bmp
- use image file
- e.g. ./main test.jpg
- input = number (e.g. 0, 1, 2, ...)
- use camera
- e.g. ./main 0
- input = jetson
- use camera via gstreamer on Jetson
- e.g. ./main jetsonInferenceHelper/inference_helper/CMakeLists.txtgit clone https://github.com/iwatake2222/play_with_tensorrt.git
cd play_with_tensorrt
git submodule update --init
sh InferenceHelper/third_party/download_prebuilt_libraries.shsh ./download_resource.shcd pj_tensorrt_cls_mobilenet_v2 # for example
mkdir -p build && cd build
cmake ..
make
./mainWhere is the source code : path-to-play_with_tensorrt/pj_tensorrt_cls_mobilenet_v2 (for example)Where to build the binaries : path-to-build (any)main.slnmain project as a startup project, then build and run!You don't need to change any configuration for TensorRT, but you can change it if you want.
xxx_engine.cpp . Please find MODEL_NAME definitioninference_helper_tensorrt.cpp automatically converts model according to the model format (extension).onnx : convert the model from onnx to trt, and save the converted trt model.uff : convert the model from uff to trt, and save the converted trt model (WIP).trt : use pre-converted trt modelresource/model/*.trtCalibrationTable_cal.txtSetDlaCore(0) or SetDlaCore(1) to use DLAinference_helper_tensorrt.cpp1 << 30inference_helper/tensorrt/calibration/batchPrepare.pypython .\batchPrepare.py --inDir sample_org --outDir sample_ppm .onnx modelCAL_DIR and define USE_INT8No open issues yet, or sync has not completed.