@@ -199,7 +199,7 @@ const char* YOLO_V8::RunSession(const cv::Mat& iImg, std::vector<DL_RESULT>& oRe
199199#ifdef YOLO_ONNX_ROS_CUDA_ENABLED
200200 half* blob = new half[processedImg.total () * 3 ];
201201 BlobFromImage (processedImg, blob);
202- std::vector<int64_t > inputNodeDims = { 1 , 3 , imgSize .at (1 ), imgSize .at (0 ) };
202+ std::vector<int64_t > inputNodeDims = { 1 , 3 , imgSize_ .at (1 ), imgSize_ .at (0 ) };
203203 TensorProcess (starttime_1, iImg, blob, inputNodeDims, oResult);
204204#endif
205205 }
@@ -372,13 +372,13 @@ char* YOLO_V8::WarmUpSession() {
372372#ifdef YOLO_ONNX_ROS_CUDA_ENABLED
373373 half* blob = new half[iImg.total () * 3 ];
374374 BlobFromImage (processedImg, blob);
375- std::vector<int64_t > YOLO_input_node_dims = { 1 , 3 , imgSize .at (1 ), imgSize .at (0 ) };
376- Ort::Value input_tensor = Ort::Value::CreateTensor<half>(Ort::MemoryInfo::CreateCpu (OrtDeviceAllocator, OrtMemTypeCPU), blob, 3 * imgSize .at (0 ) * imgSize .at (1 ), YOLO_input_node_dims.data (), YOLO_input_node_dims.size ());
377- auto output_tensors = session ->Run (options, inputNodeNames .data (), &input_tensor, 1 , outputNodeNames .data (), outputNodeNames .size ());
375+ std::vector<int64_t > YOLO_input_node_dims = { 1 , 3 , imgSize_ .at (1 ), imgSize_ .at (0 ) };
376+ Ort::Value input_tensor = Ort::Value::CreateTensor<half>(Ort::MemoryInfo::CreateCpu (OrtDeviceAllocator, OrtMemTypeCPU), blob, 3 * imgSize_ .at (0 ) * imgSize_ .at (1 ), YOLO_input_node_dims.data (), YOLO_input_node_dims.size ());
377+ auto output_tensors = session_ ->Run (options, inputNodeNames_ .data (), &input_tensor, 1 , outputNodeNames_ .data (), outputNodeNames_ .size ());
378378 delete[] blob;
379379 clock_t starttime_4 = clock ();
380380 double post_process_time = (double )(starttime_4 - starttime_1) / CLOCKS_PER_SEC * 1000 ;
381- if (cudaEnable )
381+ if (cudaEnable_ )
382382 {
383383 std::cout << " [YOLO_V8(CUDA)]: " << " Cuda warm-up cost " << post_process_time << " ms. " << std::endl;
384384 }
0 commit comments