Comments (4)
Thank you very much for help! I've checked and it works for me as well!
from play_with_tensorrt.
Please check and modify the settings in the following lines for your model.
https://github.com/iwatake2222/play_with_tensorrt/blob/master/pj_tensorrt_det_yolox/image_processor/detection_engine.cpp#L44
L44 - L50
I tested YOLOX tiny (https://github.com/PINTO0309/PINTO_model_zoo/blob/main/132_YOLOX/download_tiny.sh ), and it worked. However, I didn't test larger models such as YOLOX-m and YOLOX-l. The possibility is that these models need different post-process logic or parameters than YOLOX-tiny, -nano.
If you could share your ONNX model, I'll test it. Maybe you can upload (drag&drop) the model here.
from play_with_tensorrt.
Hi, thanks for quick response. I'll look into the code soon. Meanwhile, since models weigh 100 to 200 MB each and I was unable to upload them to github, here is the link to my drive containing these models:
https://drive.google.com/drive/folders/1ZOQUw5eoPOA7WtTBYDyP1MIyxupYY6GR?usp=sharing
I also uploaded video I was using for testing.
from play_with_tensorrt.
Hi, I got it worked! Please modify detection_engine.cpp
like the followings.
The point is input data normalization. The ONNX model exported from the original repo expects input data in the range of 0 - 255. However, my code uses another model which was converted in a different way and expects input data in the range of around -2.2 - 2.2 (or 0.0 - 1.0).
diff --git a/pj_tensorrt_det_yolox/image_processor/detection_engine.cpp b/pj_tensorrt_det_yolox/image_processor/detection_engine.cpp
index 6f87969..08df8e3 100644
--- a/pj_tensorrt_det_yolox/image_processor/detection_engine.cpp
+++ b/pj_tensorrt_det_yolox/image_processor/detection_engine.cpp
@@ -41,12 +41,12 @@ limitations under the License.
#define PRINT_E(...) COMMON_HELPER_PRINT_E(TAG, __VA_ARGS__)
/* Model parameters */
-#define MODEL_NAME "yolox_nano_480x640.onnx"
+#define MODEL_NAME "yolox_m_736x1280.onnx"
#define TENSORTYPE TensorInfo::kTensorTypeFp32
#define INPUT_NAME "images"
-#define INPUT_DIMS { 1, 3, 480, 640 }
+#define INPUT_DIMS { 1, 3, 736, 1280 }
#define IS_NCHW true
-#define IS_RGB true
+#define IS_RGB false
#define OUTPUT_NAME "output"
static constexpr int32_t kGridScaleList[] = { 8, 16, 32 };
@@ -69,12 +69,12 @@ int32_t DetectionEngine::Initialize(const std::string& work_dir, const int32_t n
InputTensorInfo input_tensor_info(INPUT_NAME, TENSORTYPE, IS_NCHW);
input_tensor_info.tensor_dims = INPUT_DIMS;
input_tensor_info.data_type = InputTensorInfo::kDataTypeImage;
- input_tensor_info.normalize.mean[0] = 0.485f;
- input_tensor_info.normalize.mean[1] = 0.456f;
- input_tensor_info.normalize.mean[2] = 0.406f;
- input_tensor_info.normalize.norm[0] = 0.229f;
- input_tensor_info.normalize.norm[1] = 0.224f;
- input_tensor_info.normalize.norm[2] = 0.225f;
+ input_tensor_info.normalize.mean[0] = 0.0f;
+ input_tensor_info.normalize.mean[1] = 0.0f;
+ input_tensor_info.normalize.mean[2] = 0.0f;
+ input_tensor_info.normalize.norm[0] = 1.0f / 255.0f;
+ input_tensor_info.normalize.norm[1] = 1.0f / 255.0f;
+ input_tensor_info.normalize.norm[2] = 1.0f / 255.0f;
input_tensor_info_list_.push_back(input_tensor_info);
from play_with_tensorrt.
Related Issues (20)
- Question about int8 Calibration HOT 5
- about run pj_tensorrt_seg_robust_video_matting Issue? HOT 10
- Int8 Calibration trying to read non existing file HOT 3
- Calibration failed with virtualMemoryBuffer.cpp::nvinfer1::StdVirtualMemoryBufferImpl
- Yolov5 Classification
- paddleseg_cityscapessota
- Yolov5-Seg HOT 1
- How can I make a model with input size 640x384 from 640x640, the original Yolov7 training? HOT 2
- TensorRT Cuda HOT 1
- How can I convert yolopv2.pt to yolopv2_384x640.onnx? HOT 2
- yolov7 error while convertting (yolov7_736x1280.onnx to TensorRT engine) in ./main HOT 3
- Cannot find binding of given name: anchor_grid0 HOT 2
- usage of dynamic/static batch for yolov7
- Cannot find binding of given name: tf.identity (pj_tensorrt_seg_paddleseg_cityscapessota)
- 请问ufld_v2中模型文件.pth转换到.onnx的方法 HOT 2
- Float32 input and Int32 output - segmentation fault
- The Stereo algorithm is implemented using TensorRT
- what GCC and G++ versions is needed to compile?
- /usr/bin/ld: cannot find -lnvinfer: No such file or directory HOT 1
- Stereo Algorithms (Include:CREStereo,RAFT-Stereo,Hitnet,FastACVNet_plus,Stereo Transformers,RealtimeStereo,DistDepth) with TensorRT,ORT,OpenVINO
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play_with_tensorrt.