Skip to content

Commit

Permalink
Bug fix in OVEP csharp sample (#142)
Browse files Browse the repository at this point in the history
* bug fix in OVEP csharp sample

* Samples updated

* cpp sample update

* Improve the SNPE EP sample with command line option to switch SNPE backend (#120)

* Improve the sample with command line option to switch SNPE backend, and set the input file path.
Fix an issue for Android build, need to use libc++_shared.so from SNPE SDK.

* 1. Update the API call according the API change in Ort, SessionOptionsAppendExecutionProvider_SNPE -> SessionOptionsAppendExecutionProvider
2. format update

* Add table of contents to Python samples (#115)

* update doc for Snpe EP to reflect the API change (#122)

* update doc for snpe to reflect the API change

* Set default format to QuantFormat.QDQ (#123)

* Add MAUI example for mobile targets (#128)

* Add short term workaround to issue with iOS publish where the CoreML frameworks is not added to the link list. Pending real fix from MAUI folks. (#131)

Also update ORT to 1.12.1 which has a better Android build.

* Quantization tool example bug fix (#133)

In ResNet50DataReader, it uses an onnx session to obtain the model input shape. However it passes a madeup model name to the onnx session, resulting in file not found error.

This change provide the original float model path to the data reader

* sample notebooks for yolov4 and tiny-yoloV2 (#136)

* sample notebooks for yolov4 and tiny-yoloV2

* folder restucturing for notebooks

* folder restucturing for notebooks

Co-authored-by: krishnendukx <krishnendux.kar@intel.com>
Co-authored-by: krishnendukx <111554749+krishnendukx@users.noreply.github.com>

* Update MauiVisionSample SkiaSharp dependency version to 2.88.1. (#135)

Includes this fix in SkiaSharp: mono/SkiaSharp#2198

* add qdq debugging example (#134)

Adding example run_qdq_debug.py

* Adding quantization example for gpt-2 medium (#140)

add gpt2 qdq example

* Remove deprecated API usage (#144)

Co-authored-by: nmaajidk <n.maajid.khan@intel.com>
Co-authored-by: Hector Li <hecli@microsoft.com>
Co-authored-by: Nat Kershaw (MSFT) <nakersha@microsoft.com>
Co-authored-by: Yufeng Li <liyufeng1987@gmail.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
Co-authored-by: Chen Fu <1316708+chenfucn@users.noreply.github.com>
Co-authored-by: sfatimar <sahar.fatima@intel.com>
Co-authored-by: krishnendukx <krishnendux.kar@intel.com>
Co-authored-by: krishnendukx <111554749+krishnendukx@users.noreply.github.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: Dmitri Smirnov <yuslepukhin@users.noreply.github.com>
  • Loading branch information
12 people authored Oct 27, 2022
1 parent c094626 commit 4999a7f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
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

0 comments on commit 4999a7f

Please sign in to comment.