From f00a798c8bf59f43ab557a2f3d566afa831c8887 Mon Sep 17 00:00:00 2001 From: Feng Wang Date: Tue, 30 Jul 2024 11:58:00 +0800 Subject: [PATCH] fix(demo): revert #1786 and update trt doc (#1792) --- demo/TensorRT/cpp/README.md | 10 ++++++++++ demo/TensorRT/cpp/yolox.cpp | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/demo/TensorRT/cpp/README.md b/demo/TensorRT/cpp/README.md index 0158e7dac..e3dee80ce 100644 --- a/demo/TensorRT/cpp/README.md +++ b/demo/TensorRT/cpp/README.md @@ -46,3 +46,13 @@ or ./yolox -i ``` +NOTE: for `trtexec` users, modify `INPUT_BLOB_NAME` and `OUTPUT_BLOB_NAME` as the following code. +``` +const char* INPUT_BLOB_NAME = "images"; +const char* OUTPUT_BLOB_NAME = "output"; +``` + +Here is the command to convert the small onnx model to tensorrt engine file: +``` +trtexec --onnx=yolox_s.onnx --saveEngine=yolox_s.trt +``` diff --git a/demo/TensorRT/cpp/yolox.cpp b/demo/TensorRT/cpp/yolox.cpp index e5d1ce73c..ed423380e 100644 --- a/demo/TensorRT/cpp/yolox.cpp +++ b/demo/TensorRT/cpp/yolox.cpp @@ -31,8 +31,8 @@ using namespace nvinfer1; static const int INPUT_W = 640; static const int INPUT_H = 640; static const int NUM_CLASSES = 80; -const char* INPUT_BLOB_NAME = "images"; -const char* OUTPUT_BLOB_NAME = "output"; +const char* INPUT_BLOB_NAME = "input_0"; +const char* OUTPUT_BLOB_NAME = "output_0"; static Logger gLogger; cv::Mat static_resize(cv::Mat& img) {