Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -242,7 +243,8 @@ int main(int argc, char* argv[])
std::vector<int64_t> 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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down Expand Up @@ -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);
Expand All @@ -272,7 +274,8 @@ int main(int argc, char* argv[])
std::vector<int64_t> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -247,7 +248,8 @@ int main(int argc, char* argv[])
std::vector<int64_t> 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);
Expand Down
23 changes: 13 additions & 10 deletions c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down