From e687c09423f2da0aeef38441461eb804c6a739ca Mon Sep 17 00:00:00 2001 From: "Umit Kacar, PhD" Date: Thu, 4 Jan 2024 00:05:05 +0000 Subject: [PATCH] Update inference.cpp (bug) (#7279) --- examples/YOLOv8-ONNXRuntime-CPP/inference.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/YOLOv8-ONNXRuntime-CPP/inference.cpp b/examples/YOLOv8-ONNXRuntime-CPP/inference.cpp index 3d0427f32..ad2b95dcc 100644 --- a/examples/YOLOv8-ONNXRuntime-CPP/inference.cpp +++ b/examples/YOLOv8-ONNXRuntime-CPP/inference.cpp @@ -127,7 +127,7 @@ char* YOLO_V8::CreateSession(DL_INIT_PARAM& iParams) { wide_cstr[ModelPathSize] = L'\0'; const wchar_t* modelPath = wide_cstr; #else - const char* modelPath = iParams.ModelPath.c_str(); + const char* modelPath = iParams.modelPath.c_str(); #endif // _WIN32 session = new Ort::Session(env, modelPath, sessionOption); @@ -215,7 +215,7 @@ char* YOLO_V8::TensorProcess(clock_t& starttime_1, cv::Mat& iImg, N& blob, std:: auto tensor_info = typeInfo.GetTensorTypeAndShapeInfo(); std::vector outputNodeDims = tensor_info.GetShape(); auto output = outputTensor.front().GetTensorMutableData::type>(); - delete blob; + delete[] blob; switch (modelType) { case YOLO_DETECT_V8: