diff --git a/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app.cpp b/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app.cpp index 7e0786260..18e2de6dd 100644 --- a/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app.cpp +++ b/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app.cpp @@ -230,7 +230,8 @@ int main(int argc, char* argv[]) std::cout << "Number of Input Nodes: " << numInputNodes << std::endl; std::cout << "Number of Output Nodes: " << numOutputNodes << std::endl; - const char* inputName = session.GetInputName(0, allocator); + auto inputNodeName = session.GetInputNameAllocated(0, allocator); + const char* inputName = inputNodeName.get(); std::cout << "Input Name: " << inputName << std::endl; Ort::TypeInfo inputTypeInfo = session.GetInputTypeInfo(0); @@ -242,7 +243,8 @@ int main(int argc, char* argv[]) std::vector inputDims = inputTensorInfo.GetShape(); std::cout << "Input Dimensions: " << inputDims << std::endl; - const char* outputName = session.GetOutputName(0, allocator); + auto outputNodeName = session.GetOutputNameAllocated(0, allocator); + const char* outputName = outputNodeName.get(); std::cout << "Output Name: " << outputName << std::endl; Ort::TypeInfo outputTypeInfo = session.GetOutputTypeInfo(0); diff --git a/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app_io.cpp b/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app_io.cpp index c0642d03f..ec84669d6 100644 --- a/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app_io.cpp +++ b/c_cxx/OpenVINO_EP/Linux/squeezenet_classification/squeezenet_cpp_app_io.cpp @@ -1,6 +1,7 @@ /* Copyright (C) 2021, Intel Corporation SPDX-License-Identifier: Apache-2.0 + Portions of this software are copyright of their respective authors and released under the MIT license: - ONNX-Runtime-Inference, Copyright 2020 Lei Mao. For licensing see https://github.com/leimao/ONNX-Runtime-Inference/blob/main/LICENSE.md */ @@ -260,7 +261,8 @@ int main(int argc, char* argv[]) std::cout << "Number of Input Nodes: " << numInputNodes << std::endl; std::cout << "Number of Output Nodes: " << numOutputNodes << std::endl; - const char* inputName = session.GetInputName(0, allocator); + auto inputNodeName = session.GetInputNameAllocated(0, allocator); + const char* inputName = inputNodeName.get(); std::cout << "Input Name: " << inputName << std::endl; Ort::TypeInfo inputTypeInfo = session.GetInputTypeInfo(0); @@ -272,7 +274,8 @@ int main(int argc, char* argv[]) std::vector inputDims = inputTensorInfo.GetShape(); std::cout << "Input Dimensions: " << inputDims << std::endl; - const char* outputName = session.GetOutputName(0, allocator); + auto outputNodeName = session.GetOutputNameAllocated(0, allocator); + const char* outputName = outputNodeName.get(); std::cout << "Output Name: " << outputName << std::endl; Ort::TypeInfo outputTypeInfo = session.GetOutputTypeInfo(0); diff --git a/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp b/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp index fe1a70a66..3349494ca 100644 --- a/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp +++ b/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp @@ -235,7 +235,8 @@ int main(int argc, char* argv[]) std::cout << "Number of Input Nodes: " << numInputNodes << std::endl; std::cout << "Number of Output Nodes: " << numOutputNodes << std::endl; - const char* inputName = session.GetInputName(0, allocator); + auto inputNodeName = session.GetInputNameAllocated(0, allocator); + const char* inputName = inputNodeName.get(); std::cout << "Input Name: " << inputName << std::endl; Ort::TypeInfo inputTypeInfo = session.GetInputTypeInfo(0); @@ -247,7 +248,8 @@ int main(int argc, char* argv[]) std::vector inputDims = inputTensorInfo.GetShape(); std::cout << "Input Dimensions: " << inputDims << std::endl; - const char* outputName = session.GetOutputName(0, allocator); + auto outputNodeName = session.GetOutputNameAllocated(0, allocator); + const char* outputName = outputNodeName.get(); std::cout << "Output Name: " << outputName << std::endl; Ort::TypeInfo outputTypeInfo = session.GetOutputTypeInfo(0); diff --git a/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs b/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs index 8ac757e1c..cdddc5628 100644 --- a/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs +++ b/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs @@ -133,17 +133,20 @@ static void Main(string[] args) for (int i = 0; i < indices.Length; i = i + 3) { out_classes[count] = indices[i + 1]; - out_scores[count] = scores[indices[i], indices[i + 1], indices[i + 2]]; - predictions.Add(new Prediction + if (indices[i + 1] > -1) { - Box = new Box(boxes[indices[i], indices[i + 2], 1], - boxes[indices[i], indices[i + 2], 0], - boxes[indices[i], indices[i + 2], 3], - boxes[indices[i], indices[i + 2], 2]), - Class = LabelMap.Labels[out_classes[count]], - Score = out_scores[count] - }); - count++; + out_scores[count] = scores[indices[i], indices[i + 1], indices[i + 2]]; + predictions.Add(new Prediction + { + Box = new Box(boxes[indices[i], indices[i + 2], 1], + boxes[indices[i], indices[i + 2], 0], + boxes[indices[i], indices[i + 2], 3], + boxes[indices[i], indices[i + 2], 2]), + Class = LabelMap.Labels[out_classes[count]], + Score = out_scores[count] + }); + count++; + } } // Put boxes, labels and confidence on image and save for viewing