Files
openvino/docs/snippets/movidius-programming-guide.cpp
Ilya Lavrenov 02bc98a03f Removed suppressions for IInferRequest deprecation (#5310)
* Removed suppressions for IInferRequest deprecation

* Fixed Windows

* More fixes for Windows

* Fixed compilation on Windows

* Fixed comment in documentatipn

* Fixes for Andorid

* Fixes for old gcc 4.8

* WA for cross-compilations

* Fixed compilation

* Fixed HETERO plugin compilation for old compilers

* Flags

Co-authored-by: lab_ddpqa <lab_ddpqa@intel.com>
2021-04-21 16:05:30 +03:00

37 lines
817 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <inference_engine.hpp>
int main() {
InferenceEngine::Core core;
int numRequests = 42;
int i = 1;
auto network = core.ReadNetwork("sample.xml");
auto executable_network = core.LoadNetwork(network, "CPU");
//! [part0]
struct Request {
InferenceEngine::InferRequest inferRequest;
int frameidx;
};
//! [part0]
//! [part1]
// numRequests is the number of frames (max size, equal to the number of VPUs in use)
std::vector<Request> request(numRequests);
//! [part1]
//! [part2]
// initialize infer request pointer Consult IE API for more detail.
request[i].inferRequest = executable_network.CreateInferRequest();
//! [part2]
//! [part3]
// Run inference
request[i].inferRequest.StartAsync();
//! [part3]
//! [part4]
request[i].inferRequest.SetCompletionCallback([] () {});
//! [part4]
return 0;
}