- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to run inference on the NCS2 on non-image data, shape 200x6. I'm stuck on how to make an input blob. The example code is all image or audio based so it's not obvious to me how to form more generic data into a blob.
It starts life as an array of arrays (or vector of vectors) of floats. I can potentially convert to other forms first if it makes the conversion to a blob workable.
I know the NCS2 can do it because I have it working in Python, but of course most of the detail is hidden there so it's not much help. Can anyone advise on how I might convert a standard CPP array to an input blob which can be passed into an inference request?
I'm happy to supply more information, but trying to keep it general for now.
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Colin,
Greetings to you.
You’re right, the example code does not have array based. That would upset me too.
Anyway, you can create blob using the InferenceEngine::Blob or InferenceEngine::TBlob classes.
An implementation step-by-step guide is provided in the Integration Steps. Point No. 6 (Prepare Input) provides some options to prepare input, which may help you.
In addition, I would like to share a video on example implementation of Inference-Engine main function calls.
Inference-Engine API Sample Code
Regards,
Peh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the tips.
The video still assumes you're working with images and it isn't clear how I'd do anything without cv. The integration steps documentation says this:
/** Iterate over all input blobs **/
for (auto & item : input_info) {
auto input_name = item.first;
/** Get input blob **/
auto input = infer_request.GetBlob(input_name);
/** Fill input tensor with planes. First b channel, then g and r channels **/
// ...
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually I think I'll probably struggle with reading the output blob as well when it comes to it. The output should just be three numbers so would be nice if I could index into it directly, but doesn't look like that's going to be possible based on what's going on in the examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Colin,
Greetings to you.
We don’t have a specific example for array as an input. I am so sorry for that.
For non-image workloads, I would suggest you have a look at supported models such as GNMT, BERT, TDNN, ESPNet, and the following demos and sample :
- BERT Question Answering Python\* Demo
- BERT Question Answering Embedding Python\* Demo
- Speech Recognition Python\* Demo
- Text-to-speech Python\* Demo
- Automatic Speech Recognition C++ Sample
Regards,
Peh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
I am intending to look more closely at the speech recognition example as it seems closest to what I need.
Is there any possibility of creating an array- or vector-based example? It seems like it would be a good thing to include as it's a common point that we can all reach no matter what kind of data we're working with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Colin,
Greetings to you. I’m glad to hear that you’ve found the example that close to what you need. The full implementation of this coding can be found in this directory:
<path_to_openvino>\inference_engine\samples\cpp\speech_sample
You may also find from this link:
I hope this example will help you to achieve what you need.
Regards,
Yu Chern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Colin,
This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.
Regards,
Yu Chern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately I don't think you have provided a solution. This example uses the same techniques as the others and gives not clue at all how I might make use of arbitrary data stored in other forms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have found CopyVectorToBlob() here: https://docs.openvinotoolkit.org/2021.2/ie_plugin_api/group__ie__dev__api__memory.html
but the documentation is not clear on how to use it. It does not appear to exist in the InferenceEngine namespace. Can you help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Colin,
Greetings to you.
First of all, I would like to apologize for misusing the word “solution”. Next, we do not have any example on how to use array or vector-based data into the blob currently.
Therefore, we would like to clearly know and understand your end goal that you intend to achieve. Furthermore, we would like to request your model, input file, expected output and any other necessary files for us to assist you further.
You may email your files privately to us if you do not want to share in public.
Regards,
Peh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Colin,
Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.
Regards,
Peh

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page