DOCS-clear out the integrate_with_app article (#11799)
* DOCS-clear out the integrate_with_app article * Update docs/OV_Runtime_UG/integrate_with_your_application.md Co-authored-by: Yuan Xu <yuan1.xu@intel.com> Co-authored-by: Yuan Xu <yuan1.xu@intel.com>
This commit is contained in:
1 parent
275f2adf52
commit
e70074d9db
1 file changed
+14
-24
@@ -12,19 +12,12 @@
|
||||
|
||||
@endsphinxdirective
|
||||
|
||||
> **NOTE**: Before start using OpenVINO™ Runtime, make sure you set all environment variables during the installation. To do so, follow the instructions from the _Set the Environment Variables_ section in the installation guides:
|
||||
> * [For Windows* 10](../install_guides/installing-openvino-windows.md)
|
||||
> * [For Linux*](../install_guides/installing-openvino-linux.md)
|
||||
> * [For macOS*](../install_guides/installing-openvino-macos.md)
|
||||
> * To build an open source version, use the [OpenVINO™ Runtime Build Instructions](https://github.com/openvinotoolkit/openvino/wiki/BuildingCode).
|
||||
|
||||
## Use OpenVINO™ Runtime API to Implement Inference Pipeline
|
||||
|
||||
This section provides step-by-step instructions to implement a typical inference pipeline with the OpenVINO™ Runtime C++ or Python API:
|
||||
Following these steps, you can implement a typical OpenVINO™ Runtime inference pipeline in your application. Before proceeding, make sure you have [installed OpenVINO Runtime](../install_guides/installing-openvino-runtime.md).
|
||||
|
||||
![ie_api_use_cpp]
|
||||
|
||||
### Step 1. Create OpenVINO™ Runtime Core
|
||||
## Step 1. Create OpenVINO™ Runtime Core
|
||||
|
||||
Include next files to work with OpenVINO™ Runtime:
|
||||
|
||||
@@ -62,7 +55,7 @@ Use the following code to create OpenVINO™ Core to manage available devices an
|
||||
|
||||
@endsphinxtabset
|
||||
|
||||
### Step 2. Compile the Model
|
||||
## Step 2. Compile the Model
|
||||
|
||||
`ov::CompiledModel` class represents a device specific compiled model. `ov::CompiledModel` allows you to get information inputs or output ports by a tensor name or index. This approach is aligned with the majority of frameworks.
|
||||
|
||||
@@ -143,7 +136,7 @@ The code above creates a compiled model associated with a single hardware device
|
||||
It is possible to create as many compiled models as needed and use them simultaneously (up to the limitation of the hardware resources).
|
||||
To learn how to change the device configuration, read the [Query device properties](./supported_plugins/config_properties.md) article.
|
||||
|
||||
### Step 3. Create an Inference Request
|
||||
## Step 3. Create an Inference Request
|
||||
|
||||
`ov::InferRequest` class provides methods for model inference in OpenVINO™ Runtime. Create an infer request using the following code (see [InferRequest detailed documentation](./ov_infer_request.md) for more details):
|
||||
|
||||
@@ -163,7 +156,7 @@ To learn how to change the device configuration, read the [Query device properti
|
||||
|
||||
@endsphinxtabset
|
||||
|
||||
### Step 4. Set Inputs
|
||||
## Step 4. Set Inputs
|
||||
|
||||
You can use external memory to create `ov::Tensor` and use the `ov::InferRequest::set_input_tensor` method to put this tensor on the device:
|
||||
|
||||
@@ -183,7 +176,7 @@ You can use external memory to create `ov::Tensor` and use the `ov::InferRequest
|
||||
|
||||
@endsphinxtabset
|
||||
|
||||
### Step 5. Start Inference
|
||||
## Step 5. Start Inference
|
||||
|
||||
OpenVINO™ Runtime supports inference in either synchronous or asynchronous mode. Using the Async API can improve application's overall frame-rate: instead of waiting for inference to complete, the app can keep working on the host while the accelerator is busy. You can use `ov::InferRequest::start_async` to start model inference in the asynchronous mode and call `ov::InferRequest::wait` to wait for the inference results:
|
||||
|
||||
@@ -205,7 +198,7 @@ OpenVINO™ Runtime supports inference in either synchronous or asynchronous mod
|
||||
|
||||
This section demonstrates a simple pipeline. To get more information about other ways to perform inference, read the dedicated ["Run inference" section](./ov_infer_request.md).
|
||||
|
||||
### Step 6. Process the Inference Results
|
||||
## Step 6. Process the Inference Results
|
||||
|
||||
Go over the output tensors and process the inference results.
|
||||
|
||||
@@ -225,11 +218,11 @@ Go over the output tensors and process the inference results.
|
||||
|
||||
@endsphinxtabset
|
||||
|
||||
## Link and Build Your C++ Application with OpenVINO™ Runtime
|
||||
## Step 7. Link and Build Your Application with OpenVINO™ Runtime (example)
|
||||
|
||||
The example uses CMake for project configuration.
|
||||
This step may differ for different projects. In this example, a C++ application is used, together with CMake for project configuration.
|
||||
|
||||
1. **Create a structure** for the project:
|
||||
### Create a structure for the project:
|
||||
``` sh
|
||||
project/
|
||||
├── CMakeLists.txt - CMake file to build
|
||||
@@ -240,25 +233,22 @@ The example uses CMake for project configuration.
|
||||
...
|
||||
```
|
||||
|
||||
2. **Include OpenVINO™ Runtime libraries** in `project/CMakeLists.txt`
|
||||
### Include OpenVINO™ Runtime libraries in `project/CMakeLists.txt`
|
||||
|
||||
@snippet snippets/CMakeLists.txt cmake:integration_example
|
||||
|
||||
To build your project using CMake with the default build tools currently available on your machine, execute the following commands:
|
||||
|
||||
> **NOTE**: Make sure you set environment variables first by running `<INSTALL_DIR>/setupvars.sh` (or `setupvars.bat` for Windows). Otherwise the `OpenVINO_DIR` variable won't be configured properly to pass `find_package` calls.
|
||||
|
||||
```sh
|
||||
cd build/
|
||||
cmake ../project
|
||||
cmake --build .
|
||||
```
|
||||
|
||||
> **NOTE**: Make sure you set environment variables first by running `<INSTALL_DIR>/setupvars.sh` (or `setupvars.bat` for Windows). Otherwise the `OpenVINO_DIR` variable won't be configured properly to pass `find_package` calls.
|
||||
|
||||
You can also specify additional build options (e.g. to build CMake project on Windows with a specific build tools). Please refer to the [CMake page](https://cmake.org/cmake/help/latest/manual/cmake.1.html#manual:cmake(1)) for details.
|
||||
|
||||
## Run Your Application
|
||||
|
||||
Congratulations, you have made your first application with OpenVINO™ toolkit, now you may run it.
|
||||
|
||||
|
||||
## Additional Resources
|
||||
|
||||
|
||||
Reference in new issue
Block a user