From 803843dad9b6e66f9feb12acbff1a48c111b6164 Mon Sep 17 00:00:00 2001 From: Tatiana Savina Date: Fri, 4 Aug 2023 13:21:15 +0200 Subject: [PATCH] [DOCS] Change sample structure (#18942) --- samples/c/hello_classification/README.md | 99 +++++++++-------- .../hello_nv12_input_classification/README.md | 65 ++++++----- .../cpp/benchmark/sync_benchmark/README.md | 73 +++++++------ .../benchmark/throughput_benchmark/README.md | 76 +++++++------ .../cpp/classification_sample_async/README.md | 59 ++++++---- samples/cpp/hello_classification/README.md | 88 ++++++++------- .../hello_nv12_input_classification/README.md | 65 ++++++----- samples/cpp/hello_query_device/README.md | 41 ++++--- samples/cpp/hello_reshape_ssd/README.md | 70 +++++++----- samples/cpp/model_creation_sample/README.md | 103 ++++++++++-------- samples/cpp/speech_sample/README.md | 70 +++++++----- .../python/benchmark/bert_benchmark/README.md | 39 ++++--- .../python/benchmark/sync_benchmark/README.md | 76 +++++++------ .../benchmark/throughput_benchmark/README.md | 82 ++++++++------ .../classification_sample_async/README.md | 58 ++++++---- samples/python/hello_classification/README.md | 79 ++++++++------ samples/python/hello_query_device/README.md | 47 +++++--- samples/python/hello_reshape_ssd/README.md | 60 ++++++---- .../python/model_creation_sample/README.md | 74 +++++++------ samples/python/speech_sample/README.md | 70 +++++++----- 20 files changed, 804 insertions(+), 590 deletions(-) diff --git a/samples/c/hello_classification/README.md b/samples/c/hello_classification/README.md index 01b2a3512d9..cb9202a3228 100644 --- a/samples/c/hello_classification/README.md +++ b/samples/c/hello_classification/README.md @@ -10,52 +10,63 @@ This sample demonstrates how to execute an inference of image classification networks like AlexNet and GoogLeNet using Synchronous Inference Request API and input auto-resize feature. -Hello Classification C sample application demonstrates how to use the C API from OpenVINO in applications. +.. tab-set:: -+-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Feature | API | Description | -+=====================================+=============================================================+=========================================================================================================================================================================================+ -| OpenVINO Runtime Version | ``ov_get_openvino_version`` | Get Openvino API version | -+-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Basic Infer Flow | ``ov_core_create``, | Common API to do inference: read and compile a model, create an infer request, configure input and output tensors | -| | ``ov_core_read_model``, | | -| | ``ov_core_compile_model``, | | -| | ``ov_compiled_model_create_infer_request``, | | -| | ``ov_infer_request_set_input_tensor_by_index``, | | -| | ``ov_infer_request_get_output_tensor_by_index`` | | -+-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Synchronous Infer | ``ov_infer_request_infer`` | Do synchronous inference | -+-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Operations | ``ov_model_const_input``, | Get inputs and outputs of a model | -| | ``ov_model_const_output`` | + -+-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Tensor Operations | ``ov_tensor_create_from_host_ptr`` | Create a tensor shape | -+-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Preprocessing | ``ov_preprocess_prepostprocessor_create``, | Set image of the original size as input for a model with other input size. Resize and layout conversions are performed automatically by the corresponding plugin just before inference. | -| | ``ov_preprocess_prepostprocessor_get_input_info_by_index``, | | -| | ``ov_preprocess_input_info_get_tensor_info``, | | -| | ``ov_preprocess_input_tensor_info_set_from``, | | -| | ``ov_preprocess_input_tensor_info_set_layout``, | | -| | ``ov_preprocess_input_info_get_preprocess_steps``, | | -| | ``ov_preprocess_preprocess_steps_resize``, | | -| | ``ov_preprocess_input_model_info_set_layout``, | | -| | ``ov_preprocess_output_set_element_type``, | | -| | ``ov_preprocess_prepostprocessor_build`` | | -+-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + .. tab-item:: Requirements -+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Options | Values | -+============================+============================================================================================================================================================================+ -| Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | -+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | -+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Validated images | The sample uses OpenCV\* to `read input image `__ (\*.bmp, \*.png) | -+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ `, :doc:`Python ` | -+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Options | Values | + +============================+============================================================================================================================================================================+ + | Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | + +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | + +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Validated images | The sample uses OpenCV\* to `read input image `__ (\*.bmp, \*.png) | + +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ `, :doc:`Python ` | + +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + .. tab-item:: C API + + Hello Classification C sample application demonstrates how to use the C API from OpenVINO in applications. + + +-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Feature | API | Description | + +=====================================+=============================================================+=========================================================================================================================================================================================+ + | OpenVINO Runtime Version | ``ov_get_openvino_version`` | Get Openvino API version | + +-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Basic Infer Flow | ``ov_core_create``, | Common API to do inference: read and compile a model, create an infer request, configure input and output tensors | + | | ``ov_core_read_model``, | | + | | ``ov_core_compile_model``, | | + | | ``ov_compiled_model_create_infer_request``, | | + | | ``ov_infer_request_set_input_tensor_by_index``, | | + | | ``ov_infer_request_get_output_tensor_by_index`` | | + +-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Synchronous Infer | ``ov_infer_request_infer`` | Do synchronous inference | + +-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Operations | ``ov_model_const_input``, | Get inputs and outputs of a model | + | | ``ov_model_const_output`` | + + +-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Tensor Operations | ``ov_tensor_create_from_host_ptr`` | Create a tensor shape | + +-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Preprocessing | ``ov_preprocess_prepostprocessor_create``, | Set image of the original size as input for a model with other input size. Resize and layout conversions are performed automatically by the corresponding plugin just before inference. | + | | ``ov_preprocess_prepostprocessor_get_input_info_by_index``, | | + | | ``ov_preprocess_input_info_get_tensor_info``, | | + | | ``ov_preprocess_input_tensor_info_set_from``, | | + | | ``ov_preprocess_input_tensor_info_set_layout``, | | + | | ``ov_preprocess_input_info_get_preprocess_steps``, | | + | | ``ov_preprocess_preprocess_steps_resize``, | | + | | ``ov_preprocess_input_model_info_set_layout``, | | + | | ``ov_preprocess_output_set_element_type``, | | + | | ``ov_preprocess_prepostprocessor_build`` | | + +-------------------------------------+-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/c/hello_classification/main.c + :language: c How It Works ############ diff --git a/samples/c/hello_nv12_input_classification/README.md b/samples/c/hello_nv12_input_classification/README.md index cdad2c59559..9bd811e7143 100644 --- a/samples/c/hello_nv12_input_classification/README.md +++ b/samples/c/hello_nv12_input_classification/README.md @@ -10,37 +10,48 @@ This sample demonstrates how to execute an inference of image classification networks like AlexNet with images in NV12 color format using Synchronous Inference Request API. -Hello NV12 Input Classification C Sample demonstrates how to use the NV12 automatic input pre-processing API in your applications: +Hello NV12 Input Classification C Sample demonstrates how to use the NV12 automatic input pre-processing API in your applications. -+-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ -| Feature | API | Description | -+=========================================+===========================================================+========================================================+ -| Node Operations | ``ov_port_get_any_name`` | Get a layer name | -+-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ -| Infer Request Operations | ``ov_infer_request_set_tensor``, | Operate with tensors | -| | ``ov_infer_request_get_output_tensor_by_index`` | | -+-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ -| Preprocessing | ``ov_preprocess_input_tensor_info_set_color_format``, | Change the color format of the input data | -| | ``ov_preprocess_preprocess_steps_convert_element_type``, | | -| | ``ov_preprocess_preprocess_steps_convert_color`` | | -+-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ +.. tab-set:: + + .. tab-item:: Requirements + + +-----------------------------------------+---------------------------------------------------------------------------------------+ + | Options | Values | + +=========================================+=======================================================================================+ + | Validated Models | :doc:`alexnet ` | + +-----------------------------------------+---------------------------------------------------------------------------------------+ + | Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | + +-----------------------------------------+---------------------------------------------------------------------------------------+ + | Validated images | An uncompressed image in the NV12 color format - \*.yuv | + +-----------------------------------------+---------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +-----------------------------------------+---------------------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +-----------------------------------------+---------------------------------------------------------------------------------------+ + + .. tab-item:: C API + + +-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ + | Feature | API | Description | + +=========================================+===========================================================+========================================================+ + | Node Operations | ``ov_port_get_any_name`` | Get a layer name | + +-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ + | Infer Request Operations | ``ov_infer_request_set_tensor``, | Operate with tensors | + | | ``ov_infer_request_get_output_tensor_by_index`` | | + +-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ + | Preprocessing | ``ov_preprocess_input_tensor_info_set_color_format``, | Change the color format of the input data | + | | ``ov_preprocess_preprocess_steps_convert_element_type``, | | + | | ``ov_preprocess_preprocess_steps_convert_color`` | | + +-----------------------------------------+-----------------------------------------------------------+--------------------------------------------------------+ -Basic Inference Engine API is covered by :doc:`Hello Classification C sample `. + Basic Inference Engine API is covered by :doc:`Hello Classification C sample `. -+-----------------------------------------+---------------------------------------------------------------------------------------+ -| Options | Values | -+=========================================+=======================================================================================+ -| Validated Models | :doc:`alexnet ` | -+-----------------------------------------+---------------------------------------------------------------------------------------+ -| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | -+-----------------------------------------+---------------------------------------------------------------------------------------+ -| Validated images | An uncompressed image in the NV12 color format - \*.yuv | -+-----------------------------------------+---------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+-----------------------------------------+---------------------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+-----------------------------------------+---------------------------------------------------------------------------------------+ + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/c/hello_nv12_input_classification/main.c + :language: c How It Works ############ diff --git a/samples/cpp/benchmark/sync_benchmark/README.md b/samples/cpp/benchmark/sync_benchmark/README.md index e260bf271fe..e4430f0331b 100644 --- a/samples/cpp/benchmark/sync_benchmark/README.md +++ b/samples/cpp/benchmark/sync_benchmark/README.md @@ -7,41 +7,50 @@ This sample demonstrates how to estimate performance of a model using Synchronous Inference Request API. It makes sense to use synchronous inference only in latency oriented scenarios. Models with static input shapes are supported. Unlike :doc:`demos ` this sample doesn't have other configurable command line arguments. Feel free to modify sample's source code to try out different options. -The following C++ API is used in the application: -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Feature | API | Description | -+==========================+==============================================+==============================================+ -| OpenVINO Runtime Version | ``ov::get_openvino_version`` | Get Openvino API version. | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Basic Infer Flow | ``ov::Core``, ``ov::Core::compile_model``, | Common API to do inference: compile a model, | -| | ``ov::CompiledModel::create_infer_request``, | create an infer request, | -| | ``ov::InferRequest::get_tensor`` | configure input tensors. | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Synchronous Infer | ``ov::InferRequest::infer``, | Do synchronous inference. | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Model Operations | ``ov::CompiledModel::inputs`` | Get inputs of a model. | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Tensor Operations | ``ov::Tensor::get_shape``, | Get a tensor shape and its data. | -| | ``ov::Tensor::data`` | | -+--------------------------+----------------------------------------------+----------------------------------------------+ +.. tab-set:: -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Options | Values | -+================================+================================================================================================+ -| Validated Models | :doc:`alexnet `, | -| | :doc:`googlenet-v1 `, | -| | :doc:`yolo-v3-tf `, | -| | :doc:`face-detection-0200 ` | -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation | -| | (\*.xml + \*.bin), ONNX (\*.onnx) | -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`Python ` | -+--------------------------------+------------------------------------------------------------------------------------------------+ + .. tab-item:: Requirements + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Options | Values | + +================================+================================================================================================+ + | Validated Models | :doc:`alexnet `, | + | | :doc:`googlenet-v1 `, | + | | :doc:`yolo-v3-tf `, | + | | :doc:`face-detection-0200 ` | + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation | + | | (\*.xml + \*.bin), ONNX (\*.onnx) | + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`Python ` | + +--------------------------------+------------------------------------------------------------------------------------------------+ + + .. tab-item:: C++ API + + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Feature | API | Description | + +==========================+==============================================+==============================================+ + | OpenVINO Runtime Version | ``ov::get_openvino_version`` | Get Openvino API version. | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Basic Infer Flow | ``ov::Core``, ``ov::Core::compile_model``, | Common API to do inference: compile a model, | + | | ``ov::CompiledModel::create_infer_request``, | create an infer request, | + | | ``ov::InferRequest::get_tensor`` | configure input tensors. | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Synchronous Infer | ``ov::InferRequest::infer``, | Do synchronous inference. | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Model Operations | ``ov::CompiledModel::inputs`` | Get inputs of a model. | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Tensor Operations | ``ov::Tensor::get_shape``, | Get a tensor shape and its data. | + | | ``ov::Tensor::data`` | | + +--------------------------+----------------------------------------------+----------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/benchmark/sync_benchmark/main.cpp + :language: cpp How It Works #################### diff --git a/samples/cpp/benchmark/throughput_benchmark/README.md b/samples/cpp/benchmark/throughput_benchmark/README.md index 444e053790a..0f4fb60cf8b 100644 --- a/samples/cpp/benchmark/throughput_benchmark/README.md +++ b/samples/cpp/benchmark/throughput_benchmark/README.md @@ -10,42 +10,52 @@ This sample demonstrates how to estimate performance of a model using Asynchrono The reported results may deviate from what :doc:`benchmark_app ` reports. One example is model input precision for computer vision tasks. benchmark_app sets ``uint8``, while the sample uses default model precision which is usually ``float32``. -The following C++ API is used in the application: +.. tab-set:: -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Feature | API | Description | -+==========================+==============================================+==============================================+ -| OpenVINO Runtime Version | ``ov::get_openvino_version`` | Get Openvino API version. | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Basic Infer Flow | ``ov::Core``, ``ov::Core::compile_model``, | Common API to do inference: compile a model, | -| | ``ov::CompiledModel::create_infer_request``, | create an infer request, | -| | ``ov::InferRequest::get_tensor`` | configure input tensors. | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Asynchronous Infer | ``ov::InferRequest::start_async``, | Do asynchronous inference with callback. | -| | ``ov::InferRequest::set_callback`` | | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Model Operations | ``ov::CompiledModel::inputs`` | Get inputs of a model. | -+--------------------------+----------------------------------------------+----------------------------------------------+ -| Tensor Operations | ``ov::Tensor::get_shape``, | Get a tensor shape and its data. | -| | ``ov::Tensor::data`` | | -+--------------------------+----------------------------------------------+----------------------------------------------+ + .. tab-item:: Requirements -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Options | Values | -+================================+================================================================================================+ -| Validated Models | :doc:`alexnet `, | -| | :doc:`googlenet-v1 `, | -| | :doc:`yolo-v3-tf `, | -| | :doc:`face-detection-0200 ` | -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation | -| | (\*.xml + \*.bin), ONNX (\*.onnx) | -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+--------------------------------+------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`Python ` | -+--------------------------------+------------------------------------------------------------------------------------------------+ + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Options | Values | + +================================+================================================================================================+ + | Validated Models | :doc:`alexnet `, | + | | :doc:`googlenet-v1 `, | + | | :doc:`yolo-v3-tf `, | + | | :doc:`face-detection-0200 ` | + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation | + | | (\*.xml + \*.bin), ONNX (\*.onnx) | + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +--------------------------------+------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`Python ` | + +--------------------------------+------------------------------------------------------------------------------------------------+ + .. tab-item:: C++ API + + The following C++ API is used in the application: + + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Feature | API | Description | + +==========================+==============================================+==============================================+ + | OpenVINO Runtime Version | ``ov::get_openvino_version`` | Get Openvino API version. | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Basic Infer Flow | ``ov::Core``, ``ov::Core::compile_model``, | Common API to do inference: compile a model, | + | | ``ov::CompiledModel::create_infer_request``, | create an infer request, | + | | ``ov::InferRequest::get_tensor`` | configure input tensors. | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Asynchronous Infer | ``ov::InferRequest::start_async``, | Do asynchronous inference with callback. | + | | ``ov::InferRequest::set_callback`` | | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Model Operations | ``ov::CompiledModel::inputs`` | Get inputs of a model. | + +--------------------------+----------------------------------------------+----------------------------------------------+ + | Tensor Operations | ``ov::Tensor::get_shape``, | Get a tensor shape and its data. | + | | ``ov::Tensor::data`` | | + +--------------------------+----------------------------------------------+----------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/benchmark/throughput_benchmark/main.cpp + :language: cpp How It Works #################### diff --git a/samples/cpp/classification_sample_async/README.md b/samples/cpp/classification_sample_async/README.md index b089090fbe1..d3f1244b8e4 100644 --- a/samples/cpp/classification_sample_async/README.md +++ b/samples/cpp/classification_sample_async/README.md @@ -14,33 +14,44 @@ Models with only one input and output are supported. In addition to regular images, the sample also supports single-channel ``ubyte`` images as an input for LeNet model. -The following C++ API is used in the application: +.. tab-set:: -+--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ -| Feature | API | Description | -+==========================+=======================================================================+========================================================================================+ -| Asynchronous Infer | ``ov::InferRequest::start_async``, ``ov::InferRequest::set_callback`` | Do asynchronous inference with callback. | -+--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ -| Model Operations | ``ov::Output::get_shape``, ``ov::set_batch`` | Manage the model, operate with its batch size. Set batch size using input image count. | -+--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ -| Infer Request Operations | ``ov::InferRequest::get_input_tensor`` | Get an input tensor. | -+--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ -| Tensor Operations | ``ov::shape_size``, ``ov::Tensor::data`` | Get a tensor shape size and its data. | -+--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + +----------------------------+-------------------------------------------------------------------------------------------------------+ + | Options | Values | + +============================+=======================================================================================================+ + | Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | + +----------------------------+-------------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | + +----------------------------+-------------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +----------------------------+-------------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`Python ` | + +----------------------------+-------------------------------------------------------------------------------------------------------+ -+----------------------------+-------------------------------------------------------------------------------------------------------+ -| Options | Values | -+============================+=======================================================================================================+ -| Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | -+----------------------------+-------------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | -+----------------------------+-------------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+----------------------------+-------------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`Python ` | -+----------------------------+-------------------------------------------------------------------------------------------------------+ + .. tab-item:: C++ API + + The following C++ API is used in the application: + + +--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ + | Feature | API | Description | + +==========================+=======================================================================+========================================================================================+ + | Asynchronous Infer | ``ov::InferRequest::start_async``, ``ov::InferRequest::set_callback`` | Do asynchronous inference with callback. | + +--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ + | Model Operations | ``ov::Output::get_shape``, ``ov::set_batch`` | Manage the model, operate with its batch size. Set batch size using input image count. | + +--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ + | Infer Request Operations | ``ov::InferRequest::get_input_tensor`` | Get an input tensor. | + +--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ + | Tensor Operations | ``ov::shape_size``, ``ov::Tensor::data`` | Get a tensor shape size and its data. | + +--------------------------+-----------------------------------------------------------------------+----------------------------------------------------------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/classification_sample_async/main.cpp + :language: cpp How It Works ############ diff --git a/samples/cpp/hello_classification/README.md b/samples/cpp/hello_classification/README.md index 8eb7142aee0..227aef3d673 100644 --- a/samples/cpp/hello_classification/README.md +++ b/samples/cpp/hello_classification/README.md @@ -12,46 +12,58 @@ This sample demonstrates how to do inference of image classification models usin Models with only one input and output are supported. -The following C++ API is used in the application: +.. tab-set:: -+-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Feature | API | Description | -+=====================================+================================================================+=========================================================================================================================================================================================+ -| OpenVINO Runtime Version | ``ov::get_openvino_version`` | Get Openvino API version | -+-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Basic Infer Flow | ``ov::Core::read_model``, | Common API to do inference: read and compile a model, create an infer request, configure input and output tensors | -| | ``ov::Core::compile_model``, | | -| | ``ov::CompiledModel::create_infer_request``, | | -| | ``ov::InferRequest::set_input_tensor``, | | -| | ``ov::InferRequest::get_output_tensor`` | | -+-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Synchronous Infer | ``ov::InferRequest::infer`` | Do synchronous inference | -+-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Operations | ``ov::Model::inputs``, | Get inputs and outputs of a model | -| | ``ov::Model::outputs`` | | -+-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Tensor Operations | ``ov::Tensor::get_shape`` | Get a tensor shape | -+-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Preprocessing | ``ov::preprocess::InputTensorInfo::set_element_type``, | Set image of the original size as input for a model with other input size. Resize and layout conversions are performed automatically by the corresponding plugin just before inference. | -| | ``ov::preprocess::InputTensorInfo::set_layout``, | | -| | ``ov::preprocess::InputTensorInfo::set_spatial_static_shape``, | | -| | ``ov::preprocess::PreProcessSteps::resize``, | | -| | ``ov::preprocess::InputModelInfo::set_layout``, | | -| | ``ov::preprocess::OutputTensorInfo::set_element_type``, | | -| | ``ov::preprocess::PrePostProcessor::build`` | | -+-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + .. tab-item:: Requirements + + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Options | Values | + +=====================================+=======================================================================================================================================================================================+ + | Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`C `, :doc:`Python ` | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + .. tab-item:: C++ API + + The following C++ API is used in the application: + + +-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Feature | API | Description | + +=====================================+================================================================+=========================================================================================================================================================================================+ + | OpenVINO Runtime Version | ``ov::get_openvino_version`` | Get Openvino API version | + +-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Basic Infer Flow | ``ov::Core::read_model``, | Common API to do inference: read and compile a model, create an infer request, configure input and output tensors | + | | ``ov::Core::compile_model``, | | + | | ``ov::CompiledModel::create_infer_request``, | | + | | ``ov::InferRequest::set_input_tensor``, | | + | | ``ov::InferRequest::get_output_tensor`` | | + +-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Synchronous Infer | ``ov::InferRequest::infer`` | Do synchronous inference | + +-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Operations | ``ov::Model::inputs``, | Get inputs and outputs of a model | + | | ``ov::Model::outputs`` | | + +-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Tensor Operations | ``ov::Tensor::get_shape`` | Get a tensor shape | + +-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Preprocessing | ``ov::preprocess::InputTensorInfo::set_element_type``, | Set image of the original size as input for a model with other input size. Resize and layout conversions are performed automatically by the corresponding plugin just before inference. | + | | ``ov::preprocess::InputTensorInfo::set_layout``, | | + | | ``ov::preprocess::InputTensorInfo::set_spatial_static_shape``, | | + | | ``ov::preprocess::PreProcessSteps::resize``, | | + | | ``ov::preprocess::InputModelInfo::set_layout``, | | + | | ``ov::preprocess::OutputTensorInfo::set_element_type``, | | + | | ``ov::preprocess::PrePostProcessor::build`` | | + +-------------------------------------+----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/hello_classification/main.cpp + :language: cpp -+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Options | Values | -+=====================================+=======================================================================================================================================================================================+ -| Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | -+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | -+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`C `, :doc:`Python ` | -+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ How It Works ############ diff --git a/samples/cpp/hello_nv12_input_classification/README.md b/samples/cpp/hello_nv12_input_classification/README.md index 66640d58411..5a956ae4a05 100644 --- a/samples/cpp/hello_nv12_input_classification/README.md +++ b/samples/cpp/hello_nv12_input_classification/README.md @@ -10,37 +10,48 @@ This sample demonstrates how to execute an inference of image classification models with images in NV12 color format using Synchronous Inference Request API. -The following C++ API is used in the application: +.. tab-set:: -+-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ -| Feature | API | Description | -+=====================================+=============================================================+===========================================+ -| Node Operations | ``ov::Output::get_any_name`` | Get a layer name | -+-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ -| Infer Request Operations | ``ov::InferRequest::set_tensor``, | Operate with tensors | -| | ``ov::InferRequest::get_tensor`` | | -+-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ -| Preprocessing | ``ov::preprocess::InputTensorInfo::set_color_format``, | Change the color format of the input data | -| | ``ov::preprocess::PreProcessSteps::convert_element_type``, | | -| | ``ov::preprocess::PreProcessSteps::convert_color`` | | -+-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ + .. tab-item:: Requirements + + +-------------------------------------+--------------------------------------------------------------------------------------------------+ + | Options | Values | + +=====================================+==================================================================================================+ + | Validated Models | :doc:`alexnet ` | + +-------------------------------------+--------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | + +-------------------------------------+--------------------------------------------------------------------------------------------------+ + | Validated images | An uncompressed image in the NV12 color format - \*.yuv | + +-------------------------------------+--------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +-------------------------------------+--------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`C ` | + +-------------------------------------+--------------------------------------------------------------------------------------------------+ + + .. tab-item:: C++ API + + The following C++ API is used in the application: + + +-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ + | Feature | API | Description | + +=====================================+=============================================================+===========================================+ + | Node Operations | ``ov::Output::get_any_name`` | Get a layer name | + +-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ + | Infer Request Operations | ``ov::InferRequest::set_tensor``, | Operate with tensors | + | | ``ov::InferRequest::get_tensor`` | | + +-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ + | Preprocessing | ``ov::preprocess::InputTensorInfo::set_color_format``, | Change the color format of the input data | + | | ``ov::preprocess::PreProcessSteps::convert_element_type``, | | + | | ``ov::preprocess::PreProcessSteps::convert_color`` | | + +-------------------------------------+-------------------------------------------------------------+-------------------------------------------+ -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. -+-------------------------------------+--------------------------------------------------------------------------------------------------+ -| Options | Values | -+=====================================+==================================================================================================+ -| Validated Models | :doc:`alexnet ` | -+-------------------------------------+--------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | -+-------------------------------------+--------------------------------------------------------------------------------------------------+ -| Validated images | An uncompressed image in the NV12 color format - \*.yuv | -+-------------------------------------+--------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+-------------------------------------+--------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`C ` | -+-------------------------------------+--------------------------------------------------------------------------------------------------+ + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/hello_nv12_input_classification/main.cpp + :language: cpp How It Works ############ diff --git a/samples/cpp/hello_query_device/README.md b/samples/cpp/hello_query_device/README.md index 8a83a272332..029ea1e7588 100644 --- a/samples/cpp/hello_query_device/README.md +++ b/samples/cpp/hello_query_device/README.md @@ -10,24 +10,35 @@ This sample demonstrates how to execute an query OpenVINO™ Runtime devices, prints their metrics and default configuration values, using :doc:`Properties API `. -The following C++ API is used in the application: +.. tab-set:: -+----------------------------------------+---------------------------------------+-------------------------------------------------------------------+ -| Feature | API | Description | -+========================================+=======================================+===================================================================+ -| Available Devices | ``ov::Core::get_available_devices``, | Get available devices information and configuration for inference | -| | ``ov::Core::get_property`` | | -+----------------------------------------+---------------------------------------+-------------------------------------------------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + +----------------------------------------+----------------------------------------------------------------------------------------------+ + | Options | Values | + +========================================+==============================================================================================+ + | Supported devices | :doc:`All ` | + +----------------------------------------+----------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`Python ` | + +----------------------------------------+----------------------------------------------------------------------------------------------+ -+----------------------------------------+----------------------------------------------------------------------------------------------+ -| Options | Values | -+========================================+==============================================================================================+ -| Supported devices | :doc:`All ` | -+----------------------------------------+----------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`Python ` | -+----------------------------------------+----------------------------------------------------------------------------------------------+ + .. tab-item:: C++ API + + The following C++ API is used in the application: + + +----------------------------------------+---------------------------------------+-------------------------------------------------------------------+ + | Feature | API | Description | + +========================================+=======================================+===================================================================+ + | Available Devices | ``ov::Core::get_available_devices``, | Get available devices information and configuration for inference | + | | ``ov::Core::get_property`` | | + +----------------------------------------+---------------------------------------+-------------------------------------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/hello_query_device/main.cpp + :language: cpp How It Works ############ diff --git a/samples/cpp/hello_reshape_ssd/README.md b/samples/cpp/hello_reshape_ssd/README.md index f3776717f5a..d1dec948e1b 100644 --- a/samples/cpp/hello_reshape_ssd/README.md +++ b/samples/cpp/hello_reshape_ssd/README.md @@ -11,38 +11,50 @@ This sample demonstrates how to do synchronous inference of object detection models using :doc:`input reshape feature `. Models with only one input and output are supported. -The following C++ API is used in the application: +.. tab-set:: -+----------------------------------+-------------------------------------------------------------+------------------------------------------------+ -| Feature | API | Description | -+==================================+=============================================================+================================================+ -| Node operations | ``ov::Node::get_type_info``, | Get a node info | -| | ``ngraph::op::DetectionOutput::get_type_info_static``, | | -| | ``ov::Output::get_any_name``, | | -| | ``ov::Output::get_shape`` | | -+----------------------------------+-------------------------------------------------------------+------------------------------------------------+ -| Model Operations | ``ov::Model::get_ops``, | Get model nodes, reshape input | -| | ``ov::Model::reshape`` | | -+----------------------------------+-------------------------------------------------------------+------------------------------------------------+ -| Tensor Operations | ``ov::Tensor::data`` | Get a tensor data | -+----------------------------------+-------------------------------------------------------------+------------------------------------------------+ -| Preprocessing | ``ov::preprocess::PreProcessSteps::convert_element_type``, | Model input preprocessing | -| | ``ov::preprocess::PreProcessSteps::convert_layout`` | | -+----------------------------------+-------------------------------------------------------------+------------------------------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + +----------------------------------+---------------------------------------------------------------------------------------------+ + | Options | Values | + +==================================+=============================================================================================+ + | Validated Models | :doc:`person-detection-retail-0013 ` | + +----------------------------------+---------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | + +----------------------------------+---------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +----------------------------------+---------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`Python ` | + +----------------------------------+---------------------------------------------------------------------------------------------+ + + .. tab-item:: C++ API + + The following C++ API is used in the application: + + +----------------------------------+-------------------------------------------------------------+------------------------------------------------+ + | Feature | API | Description | + +==================================+=============================================================+================================================+ + | Node operations | ``ov::Node::get_type_info``, | Get a node info | + | | ``ngraph::op::DetectionOutput::get_type_info_static``, | | + | | ``ov::Output::get_any_name``, | | + | | ``ov::Output::get_shape`` | | + +----------------------------------+-------------------------------------------------------------+------------------------------------------------+ + | Model Operations | ``ov::Model::get_ops``, | Get model nodes, reshape input | + | | ``ov::Model::reshape`` | | + +----------------------------------+-------------------------------------------------------------+------------------------------------------------+ + | Tensor Operations | ``ov::Tensor::data`` | Get a tensor data | + +----------------------------------+-------------------------------------------------------------+------------------------------------------------+ + | Preprocessing | ``ov::preprocess::PreProcessSteps::convert_element_type``, | Model input preprocessing | + | | ``ov::preprocess::PreProcessSteps::convert_layout`` | | + +----------------------------------+-------------------------------------------------------------+------------------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/hello_reshape_ssd/main.cpp + :language: cpp -+----------------------------------+---------------------------------------------------------------------------------------------+ -| Options | Values | -+==================================+=============================================================================================+ -| Validated Models | :doc:`person-detection-retail-0013 ` | -+----------------------------------+---------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) | -+----------------------------------+---------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+----------------------------------+---------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`Python ` | -+----------------------------------+---------------------------------------------------------------------------------------------+ How It Works ############ diff --git a/samples/cpp/model_creation_sample/README.md b/samples/cpp/model_creation_sample/README.md index 7d0acb80e2a..029afda5e34 100644 --- a/samples/cpp/model_creation_sample/README.md +++ b/samples/cpp/model_creation_sample/README.md @@ -12,55 +12,66 @@ This sample demonstrates how to execute an synchronous inference using :doc:`mod You do not need an XML file to create a model. The API of ov::Model allows creating a model on the fly from the source code. -The following C++ API is used in the application: +.. tab-set:: -+------------------------------------------+-----------------------------------------+---------------------------------------+ -| Feature | API | Description | -+==========================================+=========================================+=======================================+ -| OpenVINO Runtime Info | ``ov::Core::get_versions`` | Get device plugins versions | -+------------------------------------------+-----------------------------------------+---------------------------------------+ -| Shape Operations | ``ov::Output::get_shape``, | Operate with shape | -| | ``ov::Shape::size``, | | -| | ``ov::shape_size`` | | -+------------------------------------------+-----------------------------------------+---------------------------------------+ -| Tensor Operations | ``ov::Tensor::get_byte_size``, | Get tensor byte size and its data | -| | ``ov::Tensor:data`` | | -+------------------------------------------+-----------------------------------------+---------------------------------------+ -| Model Operations | ``ov::set_batch`` | Operate with model batch size | -+------------------------------------------+-----------------------------------------+---------------------------------------+ -| Infer Request Operations | ``ov::InferRequest::get_input_tensor`` | Get a input tensor | -+------------------------------------------+-----------------------------------------+---------------------------------------+ -| Model creation objects | ``ov::opset8::Parameter``, | Used to construct an OpenVINO model | -| | ``ov::Node::output``, | | -| | ``ov::opset8::Constant``, | | -| | ``ov::opset8::Convolution``, | | -| | ``ov::opset8::Add``, | | -| | ``ov::opset1::MaxPool``, | | -| | ``ov::opset8::Reshape``, | | -| | ``ov::opset8::MatMul``, | | -| | ``ov::opset8::Relu``, | | -| | ``ov::opset8::Softmax``, | | -| | ``ov::descriptor::Tensor::set_names``, | | -| | ``ov::opset8::Result``, | | -| | ``ov::Model``, | | -| | ``ov::ParameterVector::vector`` | | -+------------------------------------------+-----------------------------------------+---------------------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + +---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | Options | Values | + +=========================================================+=================================================================================================+ + | Validated Models | LeNet | + +---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | Model Format | model weights file (\*.bin) | + +---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | Validated images | single-channel ``MNIST ubyte`` images | + +---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`Python ` | + +---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -+---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| Options | Values | -+=========================================================+=================================================================================================+ -| Validated Models | LeNet | -+---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| Model Format | model weights file (\*.bin) | -+---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| Validated images | single-channel ``MNIST ubyte`` images | -+---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`Python ` | -+---------------------------------------------------------+-------------------------------------------------------------------------------------------------+ + .. tab-item:: C++ API + + The following C++ API is used in the application: + + +------------------------------------------+-----------------------------------------+---------------------------------------+ + | Feature | API | Description | + +==========================================+=========================================+=======================================+ + | OpenVINO Runtime Info | ``ov::Core::get_versions`` | Get device plugins versions | + +------------------------------------------+-----------------------------------------+---------------------------------------+ + | Shape Operations | ``ov::Output::get_shape``, | Operate with shape | + | | ``ov::Shape::size``, | | + | | ``ov::shape_size`` | | + +------------------------------------------+-----------------------------------------+---------------------------------------+ + | Tensor Operations | ``ov::Tensor::get_byte_size``, | Get tensor byte size and its data | + | | ``ov::Tensor:data`` | | + +------------------------------------------+-----------------------------------------+---------------------------------------+ + | Model Operations | ``ov::set_batch`` | Operate with model batch size | + +------------------------------------------+-----------------------------------------+---------------------------------------+ + | Infer Request Operations | ``ov::InferRequest::get_input_tensor`` | Get a input tensor | + +------------------------------------------+-----------------------------------------+---------------------------------------+ + | Model creation objects | ``ov::opset8::Parameter``, | Used to construct an OpenVINO model | + | | ``ov::Node::output``, | | + | | ``ov::opset8::Constant``, | | + | | ``ov::opset8::Convolution``, | | + | | ``ov::opset8::Add``, | | + | | ``ov::opset1::MaxPool``, | | + | | ``ov::opset8::Reshape``, | | + | | ``ov::opset8::MatMul``, | | + | | ``ov::opset8::Relu``, | | + | | ``ov::opset8::Softmax``, | | + | | ``ov::descriptor::Tensor::set_names``, | | + | | ``ov::opset8::Result``, | | + | | ``ov::Model``, | | + | | ``ov::ParameterVector::vector`` | | + +------------------------------------------+-----------------------------------------+---------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/model_creation_sample/main.cpp + :language: cpp How It Works ############ diff --git a/samples/cpp/speech_sample/README.md b/samples/cpp/speech_sample/README.md index d7c2b5e85d9..2771f141923 100644 --- a/samples/cpp/speech_sample/README.md +++ b/samples/cpp/speech_sample/README.md @@ -12,40 +12,50 @@ This sample demonstrates how to execute an Asynchronous Inference of acoustic mo The sample works with Kaldi ARK or Numpy* uncompressed NPZ files, so it does not cover an end-to-end speech recognition scenario (speech to text), requiring additional preprocessing (feature extraction) to get a feature vector from a speech signal, as well as postprocessing (decoding) to produce text from scores. -The following C++ API is used in the application: +.. tab-set:: -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| Feature | API | Description | -+=============================================================+=============================================================================================================+==============================================================================+ -| Available Devices | ``ov::Core::get_available_devices``, ``ov::Core::get_property`` | Get information of the devices for inference | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| Import/Export Model | ``ov::Core::import_model``, ``ov::CompiledModel::export_model`` | The GNA plugin supports loading and saving of the GNA-optimized model | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| Model Operations | ``ov::set_batch``, ``ov::Model::add_output``, ``ov::CompiledModel::inputs``, ``ov::CompiledModel::outputs`` | Managing of model: configure batch_size, input and output tensors | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| Node Operations | ``ov::OutputVector::size``, ``ov::Output::get_shape`` | Get node shape | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| Asynchronous Infer | ``ov::InferRequest::start_async``, ``ov::InferRequest::wait`` | Do asynchronous inference and waits until inference result becomes available | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| InferRequest Operations | ``ov::InferRequest::query_state``, ``ov::VariableState::reset`` | Gets and resets CompiledModel state control | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| Tensor Operations | ``ov::Tensor::get_size``, ``ov::Tensor::data``, ``ov::InferRequest::get_tensor`` | Get a tensor, its size and data | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ -| Profiling | ``ov::InferRequest::get_profiling_info`` | Get infer request profiling info | -+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + .. tab-item:: Requirements + +-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Options | Values | + +=============================================================+===============================================================================================================================================================+ + | Validated Models | Acoustic model based on Kaldi\* neural networks (see :ref:`Model Preparation ` section) | + +-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin) | + +-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Supported devices | See :ref:`Execution Modes ` section below and :doc:`List Supported Devices ` | + +-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + .. tab-item:: C++ API -+-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Options | Values | -+=============================================================+===============================================================================================================================================================+ -| Validated Models | Acoustic model based on Kaldi\* neural networks (see :ref:`Model Preparation ` section) | -+-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin) | -+-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Supported devices | See :ref:`Execution Modes ` section below and :doc:`List Supported Devices ` | -+-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ + The following C++ API is used in the application: + + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | Feature | API | Description | + +=============================================================+=============================================================================================================+==============================================================================+ + | Available Devices | ``ov::Core::get_available_devices``, ``ov::Core::get_property`` | Get information of the devices for inference | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | Import/Export Model | ``ov::Core::import_model``, ``ov::CompiledModel::export_model`` | The GNA plugin supports loading and saving of the GNA-optimized model | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | Model Operations | ``ov::set_batch``, ``ov::Model::add_output``, ``ov::CompiledModel::inputs``, ``ov::CompiledModel::outputs`` | Managing of model: configure batch_size, input and output tensors | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | Node Operations | ``ov::OutputVector::size``, ``ov::Output::get_shape`` | Get node shape | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | Asynchronous Infer | ``ov::InferRequest::start_async``, ``ov::InferRequest::wait`` | Do asynchronous inference and waits until inference result becomes available | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | InferRequest Operations | ``ov::InferRequest::query_state``, ``ov::VariableState::reset`` | Gets and resets CompiledModel state control | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | Tensor Operations | ``ov::Tensor::get_size``, ``ov::Tensor::data``, ``ov::InferRequest::get_tensor`` | Get a tensor, its size and data | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + | Profiling | ``ov::InferRequest::get_profiling_info`` | Get infer request profiling info | + +-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification C++ sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/cpp/speech_sample/main.cpp + :language: cpp How It Works ############ diff --git a/samples/python/benchmark/bert_benchmark/README.md b/samples/python/benchmark/bert_benchmark/README.md index e88ec1bd7d1..aa3a891e3c8 100644 --- a/samples/python/benchmark/bert_benchmark/README.md +++ b/samples/python/benchmark/bert_benchmark/README.md @@ -1,4 +1,4 @@ -# Bert Benchmark Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_bert_benchmark_README} +# Bert Benchmark Python Sample {#openvino_inference_engine_ie_bridges_python_sample_bert_benchmark_README} @sphinxdirective @@ -10,20 +10,29 @@ This sample demonstrates how to estimate performance of a Bert model using Async The following Python API is used in the application: -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Feature | API | Description | -+================================+=================================================+==============================================+ -| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model. | -| | [openvino.runtime.Core.compile_model] | | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Asynchronous Infer | [openvino.runtime.AsyncInferQueue], | Do asynchronous inference. | -| | [openvino.runtime.AsyncInferQueue.start_async], | | -| | [openvino.runtime.AsyncInferQueue.wait_all] | | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Model Operations | [openvino.runtime.CompiledModel.inputs] | Get inputs of a model. | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ +.. tab-set:: + + .. tab-item:: Python API + + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Feature | API | Description | + +================================+=================================================+==============================================+ + | OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model. | + | | [openvino.runtime.Core.compile_model] | | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Asynchronous Infer | [openvino.runtime.AsyncInferQueue], | Do asynchronous inference. | + | | [openvino.runtime.AsyncInferQueue.start_async], | | + | | [openvino.runtime.AsyncInferQueue.wait_all] | | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Model Operations | [openvino.runtime.CompiledModel.inputs] | Get inputs of a model. | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/benchmark/bert_benchmark/bert_benchmark.py + :language: python How It Works #################### diff --git a/samples/python/benchmark/sync_benchmark/README.md b/samples/python/benchmark/sync_benchmark/README.md index aa7d810bf85..ecd142cffca 100644 --- a/samples/python/benchmark/sync_benchmark/README.md +++ b/samples/python/benchmark/sync_benchmark/README.md @@ -1,4 +1,4 @@ -# Sync Benchmark Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_sync_benchmark_README} +# Sync Benchmark Python Sample {#openvino_inference_engine_ie_bridges_python_sample_sync_benchmark_README} @sphinxdirective @@ -8,42 +8,51 @@ This sample demonstrates how to estimate performance of a model using Synchronous Inference Request API. It makes sense to use synchronous inference only in latency oriented scenarios. Models with static input shapes are supported. Unlike :doc:`demos ` this sample doesn't have other configurable command line arguments. Feel free to modify sample's source code to try out different options. -The following Python API is used in the application: +.. tab-set:: + .. tab-item:: Requirements + + +--------------------------------+------------------------------------------------------------------------------+ + | Options | Values | + +================================+==============================================================================+ + | Validated Models | :doc:`alexnet `, | + | | :doc:`googlenet-v1 `, | + | | :doc:`yolo-v3-tf `, | + | | :doc:`face-detection-0200 ` | + +--------------------------------+------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation | + | | (\*.xml + \*.bin), ONNX (\*.onnx) | + +--------------------------------+------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +--------------------------------+------------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +--------------------------------+------------------------------------------------------------------------------+ -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Feature | API | Description | -+================================+=================================================+==============================================+ -| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, | -| | [openvino.runtime.Core.compile_model], | configure input tensors. | -| | [openvino.runtime.InferRequest.get_tensor] | | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Synchronous Infer | [openvino.runtime.InferRequest.infer], | Do synchronous inference. | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Model Operations | [openvino.runtime.CompiledModel.inputs] | Get inputs of a model. | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Tensor Operations | [openvino.runtime.Tensor.get_shape], | Get a tensor shape and its data. | -| | [openvino.runtime.Tensor.data] | | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ + .. tab-item:: Python API -+--------------------------------+------------------------------------------------------------------------------+ -| Options | Values | -+================================+==============================================================================+ -| Validated Models | :doc:`alexnet `, | -| | :doc:`googlenet-v1 `, | -| | :doc:`yolo-v3-tf `, | -| | :doc:`face-detection-0200 ` | -+--------------------------------+------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation | -| | (\*.xml + \*.bin), ONNX (\*.onnx) | -+--------------------------------+------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+--------------------------------+------------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+--------------------------------+------------------------------------------------------------------------------+ + The following Python API is used in the application: + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Feature | API | Description | + +================================+=================================================+==============================================+ + | OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, | + | | [openvino.runtime.Core.compile_model], | configure input tensors. | + | | [openvino.runtime.InferRequest.get_tensor] | | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Synchronous Infer | [openvino.runtime.InferRequest.infer], | Do synchronous inference. | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Model Operations | [openvino.runtime.CompiledModel.inputs] | Get inputs of a model. | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Tensor Operations | [openvino.runtime.Tensor.get_shape], | Get a tensor shape and its data. | + | | [openvino.runtime.Tensor.data] | | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/benchmark/sync_benchmark/sync_benchmark.py + :language: python How It Works #################### @@ -71,7 +80,6 @@ To run the sample, you need to specify a model: The sample accepts models in ONNX format (.onnx) that do not require preprocessing. - Example ++++++++++++++++++++ diff --git a/samples/python/benchmark/throughput_benchmark/README.md b/samples/python/benchmark/throughput_benchmark/README.md index df129f6ef4c..a9b9bc86598 100644 --- a/samples/python/benchmark/throughput_benchmark/README.md +++ b/samples/python/benchmark/throughput_benchmark/README.md @@ -1,4 +1,4 @@ -# Throughput Benchmark Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_throughput_benchmark_README} +# Throughput Benchmark Python Sample {#openvino_inference_engine_ie_bridges_python_sample_throughput_benchmark_README} @sphinxdirective @@ -10,44 +10,54 @@ This sample demonstrates how to estimate performance of a model using Asynchrono The reported results may deviate from what :doc:`benchmark_app ` reports. One example is model input precision for computer vision tasks. benchmark_app sets uint8, while the sample uses default model precision which is usually float32. -The following Python API is used in the application: +.. tab-set:: -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Feature | API | Description | -+================================+=================================================+==============================================+ -| OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, | -| | [openvino.runtime.Core.compile_model] | configure input tensors. | -| | [openvino.runtime.InferRequest.get_tensor] | | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Asynchronous Infer | [openvino.runtime.AsyncInferQueue], | Do asynchronous inference. | -| | [openvino.runtime.AsyncInferQueue.start_async], | | -| | [openvino.runtime.AsyncInferQueue.wait_all], | | -| | [openvino.runtime.InferRequest.results] | | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Model Operations | [openvino.runtime.CompiledModel.inputs] | Get inputs of a model. | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ -| Tensor Operations | [openvino.runtime.Tensor.get_shape], | Get a tensor shape and its data. | -| | [openvino.runtime.Tensor.data] | | -+--------------------------------+-------------------------------------------------+----------------------------------------------+ + .. tab-item:: Requirements -+--------------------------------+------------------------------------------------------------------------------+ -| Options | Values | -+================================+==============================================================================+ -| Validated Models | :doc:`alexnet `, | -| | :doc:`googlenet-v1 `, | -| | :doc:`yolo-v3-tf `, | -| | :doc:`face-detection-0200 ` | -+--------------------------------+------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation | -| | (\*.xml + \*.bin), ONNX (\*.onnx) | -+--------------------------------+------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+--------------------------------+------------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+--------------------------------+------------------------------------------------------------------------------+ + +--------------------------------+------------------------------------------------------------------------------+ + | Options | Values | + +================================+==============================================================================+ + | Validated Models | :doc:`alexnet `, | + | | :doc:`googlenet-v1 `, | + | | :doc:`yolo-v3-tf `, | + | | :doc:`face-detection-0200 ` | + +--------------------------------+------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation | + | | (\*.xml + \*.bin), ONNX (\*.onnx) | + +--------------------------------+------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +--------------------------------+------------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +--------------------------------+------------------------------------------------------------------------------+ + .. tab-item:: Python API + + The following Python API is used in the application: + + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Feature | API | Description | + +================================+=================================================+==============================================+ + | OpenVINO Runtime Version | [openvino.runtime.get_version] | Get Openvino API version. | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Basic Infer Flow | [openvino.runtime.Core], | Common API to do inference: compile a model, | + | | [openvino.runtime.Core.compile_model] | configure input tensors. | + | | [openvino.runtime.InferRequest.get_tensor] | | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Asynchronous Infer | [openvino.runtime.AsyncInferQueue], | Do asynchronous inference. | + | | [openvino.runtime.AsyncInferQueue.start_async], | | + | | [openvino.runtime.AsyncInferQueue.wait_all], | | + | | [openvino.runtime.InferRequest.results] | | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Model Operations | [openvino.runtime.CompiledModel.inputs] | Get inputs of a model. | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + | Tensor Operations | [openvino.runtime.Tensor.get_shape], | Get a tensor shape and its data. | + | | [openvino.runtime.Tensor.data] | | + +--------------------------------+-------------------------------------------------+----------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/benchmark/throughput_benchmark/throughput_benchmark.py + :language: python How It Works #################### diff --git a/samples/python/classification_sample_async/README.md b/samples/python/classification_sample_async/README.md index 85742e2dfa8..a9a49b0e2b6 100644 --- a/samples/python/classification_sample_async/README.md +++ b/samples/python/classification_sample_async/README.md @@ -1,4 +1,4 @@ -# Image Classification Async Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_classification_sample_async_README} +# Image Classification Async Python Sample {#openvino_inference_engine_ie_bridges_python_sample_classification_sample_async_README} @sphinxdirective @@ -11,31 +11,43 @@ This sample demonstrates how to do inference of image classification models usin Models with only 1 input and output are supported. -The following Python API is used in the application: +.. tab-set:: -+--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------+ -| Feature | API | Description | -+====================+===========================================================================================================================================================================================================+===========================+ -| Asynchronous Infer | `openvino.runtime.AsyncInferQueue `__ , | Do asynchronous inference | -| | `openvino.runtime.AsyncInferQueue.set_callback `__ , | | -| | `openvino.runtime.AsyncInferQueue.start_async `__ , | | -| | `openvino.runtime.AsyncInferQueue.wait_all `__ , | | -| | `openvino.runtime.InferRequest.results `__ | | -+--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python* Sample `. + +----------------------------+-----------------------------------------------------------------------------------+ + | Options | Values | + +============================+===================================================================================+ + | Validated Models | :doc:`alexnet ` | + +----------------------------+-----------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin), ONNX (.onnx) | + +----------------------------+-----------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +----------------------------+-----------------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +----------------------------+-----------------------------------------------------------------------------------+ + + .. tab-item:: Python API + + The following Python API is used in the application: + + +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------+ + | Feature | API | Description | + +====================+===========================================================================================================================================================================================================+===========================+ + | Asynchronous Infer | `openvino.runtime.AsyncInferQueue `__ , | Do asynchronous inference | + | | `openvino.runtime.AsyncInferQueue.set_callback `__ , | | + | | `openvino.runtime.AsyncInferQueue.start_async `__ , | | + | | `openvino.runtime.AsyncInferQueue.wait_all `__ , | | + | | `openvino.runtime.InferRequest.results `__ | | + +--------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python Sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/classification_sample_async/classification_sample_async.py + :language: python -+----------------------------+-----------------------------------------------------------------------------------+ -| Options | Values | -+============================+===================================================================================+ -| Validated Models | :doc:`alexnet ` | -+----------------------------+-----------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin), ONNX (.onnx) | -+----------------------------+-----------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+----------------------------+-----------------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+----------------------------+-----------------------------------------------------------------------------------+ How It Works ############ diff --git a/samples/python/hello_classification/README.md b/samples/python/hello_classification/README.md index 02f530ac25b..1001948656d 100644 --- a/samples/python/hello_classification/README.md +++ b/samples/python/hello_classification/README.md @@ -1,4 +1,4 @@ -# Hello Classification Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_hello_classification_README} +# Hello Classification Python Sample {#openvino_inference_engine_ie_bridges_python_sample_hello_classification_README} @sphinxdirective @@ -11,41 +11,52 @@ This sample demonstrates how to do inference of image classification models usin Models with only 1 input and output are supported. -The following Python API is used in the application: +.. tab-set:: -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Feature | API | Description | -+=============================+===========================================================================================================================================================================================================================================+============================================================================================================================================================================================+ -| Basic Infer Flow | `openvino.runtime.Core `__ , | | -| | `openvino.runtime.Core.read_model `__ , | | -| | `openvino.runtime.Core.compile_model `__ | Common API to do inference | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Synchronous Infer | `openvino.runtime.CompiledModel.infer_new_request `__ | Do synchronous inference | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Operations | `openvino.runtime.Model.inputs `__ , | Managing of model | -| | `openvino.runtime.Model.outputs `__ | | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Preprocessing | `openvino.preprocess.PrePostProcessor `__ , | Set image of the original size as input for a model with other input size. Resize and layout conversions will be performed automatically by the corresponding plugin just before inference | -| | `openvino.preprocess.InputTensorInfo.set_element_type `__ , | | -| | `openvino.preprocess.InputTensorInfo.set_layout `__ , | | -| | `openvino.preprocess.InputTensorInfo.set_spatial_static_shape `__ , | | -| | `openvino.preprocess.PreProcessSteps.resize `__ , | | -| | `openvino.preprocess.InputModelInfo.set_layout `__ , | | -| | `openvino.preprocess.OutputTensorInfo.set_element_type `__ , | | -| | `openvino.preprocess.PrePostProcessor.build `__ | | -+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + .. tab-item:: Requirements -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Options | Values | -+===================================+===================================================================================================================================================================+ -| Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin), ONNX (.onnx) | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ `, :doc:`C ` | -+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Options | Values | + +===================================+===================================================================================================================================================================+ + | Validated Models | :doc:`alexnet `, :doc:`googlenet-v1 ` | + +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin), ONNX (.onnx) | + +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ `, :doc:`C ` | + +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + .. tab-item:: Python API + + The following Python API is used in the application: + + +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Feature | API | Description | + +=============================+===========================================================================================================================================================================================================================================+============================================================================================================================================================================================+ + | Basic Infer Flow | `openvino.runtime.Core `__ , | | + | | `openvino.runtime.Core.read_model `__ , | | + | | `openvino.runtime.Core.compile_model `__ | Common API to do inference | + +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Synchronous Infer | `openvino.runtime.CompiledModel.infer_new_request `__ | Do synchronous inference | + +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Operations | `openvino.runtime.Model.inputs `__ , | Managing of model | + | | `openvino.runtime.Model.outputs `__ | | + +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Preprocessing | `openvino.preprocess.PrePostProcessor `__ , | Set image of the original size as input for a model with other input size. Resize and layout conversions will be performed automatically by the corresponding plugin just before inference | + | | `openvino.preprocess.InputTensorInfo.set_element_type `__ , | | + | | `openvino.preprocess.InputTensorInfo.set_layout `__ , | | + | | `openvino.preprocess.InputTensorInfo.set_spatial_static_shape `__ , | | + | | `openvino.preprocess.PreProcessSteps.resize `__ , | | + | | `openvino.preprocess.InputModelInfo.set_layout `__ , | | + | | `openvino.preprocess.OutputTensorInfo.set_element_type `__ , | | + | | `openvino.preprocess.PrePostProcessor.build `__ | | + +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/hello_classification/hello_classification.py + :language: python How It Works ############ diff --git a/samples/python/hello_query_device/README.md b/samples/python/hello_query_device/README.md index 39ba45bcc16..0745bcd646a 100644 --- a/samples/python/hello_query_device/README.md +++ b/samples/python/hello_query_device/README.md @@ -1,4 +1,4 @@ -# Hello Query Device Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_hello_query_device_README} +# Hello Query Device Python Sample {#openvino_inference_engine_ie_bridges_python_sample_hello_query_device_README} @sphinxdirective @@ -10,25 +10,36 @@ This sample demonstrates how to show OpenVINO™ Runtime devices and prints their metrics and default configuration values using :doc:`Query Device API feature `. -The following Python API is used in the application: +.. tab-set:: -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------+ -| Feature | API | Description | -+=======================================+============================================================================================================================================================================================+========================================+ -| Basic | `openvino.runtime.Core `__ | Common API | -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------+ -| Query Device | `openvino.runtime.Core.available_devices `__ , | Get device properties | -| | `openvino.runtime.Core.get_metric `__ , | | -| | `openvino.runtime.Core.get_config `__ | | -+---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------+ + .. tab-item:: Requirements -+-------------------------------------------------------+--------------------------------------------------------------------------+ -| Options | Values | -+=======================================================+==========================================================================+ -| Supported devices | :doc:`All ` | -+-------------------------------------------------------+--------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+-------------------------------------------------------+--------------------------------------------------------------------------+ + +-------------------------------------------------------+--------------------------------------------------------------------------+ + | Options | Values | + +=======================================================+==========================================================================+ + | Supported devices | :doc:`All ` | + +-------------------------------------------------------+--------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +-------------------------------------------------------+--------------------------------------------------------------------------+ + + .. tab-item:: Python API + + The following Python API is used in the application: + + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------+ + | Feature | API | Description | + +=======================================+============================================================================================================================================================================================+========================================+ + | Basic | `openvino.runtime.Core `__ | Common API | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------+ + | Query Device | `openvino.runtime.Core.available_devices `__ , | Get device properties | + | | `openvino.runtime.Core.get_metric `__ , | | + | | `openvino.runtime.Core.get_config `__ | | + +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------+ + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/hello_query_device/hello_query_device.py + :language: python How It Works ############ diff --git a/samples/python/hello_reshape_ssd/README.md b/samples/python/hello_reshape_ssd/README.md index 5d5cb1ed2c9..0b5587f51af 100644 --- a/samples/python/hello_reshape_ssd/README.md +++ b/samples/python/hello_reshape_ssd/README.md @@ -1,4 +1,4 @@ -# Hello Reshape SSD Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_hello_reshape_ssd_README} +# Hello Reshape SSD Python Sample {#openvino_inference_engine_ie_bridges_python_sample_hello_reshape_ssd_README} @sphinxdirective @@ -12,32 +12,44 @@ This sample demonstrates how to do synchronous inference of object detection mod Models with only 1 input and output are supported. -The following Python API is used in the application: +.. tab-set:: -+------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+ -| Feature | API | Description | -+====================================+================================================================================================================================================================================+======================================+ -| Model Operations | `openvino.runtime.Model.reshape `__ , | Managing of model | -| | `openvino.runtime.Model.input `__ , | | -| | `openvino.runtime.Output.get_any_name `__ , | | -| | `openvino.runtime.PartialShape `__ | | -+------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python* Sample `. + +------------------------------------+---------------------------------------------------------------------------+ + | Options | Values | + +====================================+===========================================================================+ + | Validated Models | :doc:`mobilenet-ssd ` | + +------------------------------------+---------------------------------------------------------------------------+ + | Validated Layout | NCHW | + +------------------------------------+---------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin), ONNX (.onnx) | + +------------------------------------+---------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +------------------------------------+---------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +------------------------------------+---------------------------------------------------------------------------+ + + .. tab-item:: Python API + + The following Python API is used in the application: + + +------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+ + | Feature | API | Description | + +====================================+================================================================================================================================================================================+======================================+ + | Model Operations | `openvino.runtime.Model.reshape `__ , | Managing of model | + | | `openvino.runtime.Model.input `__ , | | + | | `openvino.runtime.Output.get_any_name `__ , | | + | | `openvino.runtime.PartialShape `__ | | + +------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python* Sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/hello_reshape_ssd/hello_reshape_ssd.py + :language: python -+------------------------------------+---------------------------------------------------------------------------+ -| Options | Values | -+====================================+===========================================================================+ -| Validated Models | :doc:`mobilenet-ssd ` | -+------------------------------------+---------------------------------------------------------------------------+ -| Validated Layout | NCHW | -+------------------------------------+---------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin), ONNX (.onnx) | -+------------------------------------+---------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+------------------------------------+---------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+------------------------------------+---------------------------------------------------------------------------+ How It Works ############ diff --git a/samples/python/model_creation_sample/README.md b/samples/python/model_creation_sample/README.md index a02d03a87a0..72de5335247 100644 --- a/samples/python/model_creation_sample/README.md +++ b/samples/python/model_creation_sample/README.md @@ -1,4 +1,4 @@ -# Model Creation Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_model_creation_sample_README} +# Model Creation Python Sample {#openvino_inference_engine_ie_bridges_python_sample_model_creation_sample_README} @sphinxdirective @@ -10,39 +10,50 @@ This sample demonstrates how to run inference using a :doc:`model ` built on the fly that uses weights from the LeNet classification model, which is known to work well on digit classification tasks. You do not need an XML file, the model is created from the source code on the fly. -The following OpenVINO Python API is used in the application: +.. tab-set:: -+------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+ -| Feature | API | Description | -+==========================================+==============================================================================================================================================================+====================================================================================+ -| Model Operations | `openvino.runtime.Model `__ , | Managing of model | -| | `openvino.runtime.set_batch `__ , | | -| | `openvino.runtime.Model.input `__ | | -+------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+ -| Opset operations | `openvino.runtime.op.Parameter `__ , | Description of a model topology using OpenVINO Python API | -| | `openvino.runtime.op.Constant `__ , | | -| | `openvino.runtime.opset8.convolution `__ , | | -| | `openvino.runtime.opset8.add `__ , | | -| | `openvino.runtime.opset1.max_pool `__ , | | -| | `openvino.runtime.opset8.reshape `__ , | | -| | `openvino.runtime.opset8.matmul `__ , | | -| | `openvino.runtime.opset8.relu `__ , | | -| | `openvino.runtime.opset8.softmax `__ | | -+------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python* Sample `. + +------------------------------------------------+-----------------------------------------------------------------------------+ + | Options | Values | + +================================================+=============================================================================+ + | Validated Models | LeNet | + +------------------------------------------------+-----------------------------------------------------------------------------+ + | Model Format | Model weights file (\*.bin) | + +------------------------------------------------+-----------------------------------------------------------------------------+ + | Supported devices | :doc:`All ` | + +------------------------------------------------+-----------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +------------------------------------------------+-----------------------------------------------------------------------------+ -+------------------------------------------------+-----------------------------------------------------------------------------+ -| Options | Values | -+================================================+=============================================================================+ -| Validated Models | LeNet | -+------------------------------------------------+-----------------------------------------------------------------------------+ -| Model Format | Model weights file (\*.bin) | -+------------------------------------------------+-----------------------------------------------------------------------------+ -| Supported devices | :doc:`All ` | -+------------------------------------------------+-----------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+------------------------------------------------+-----------------------------------------------------------------------------+ + .. tab-item:: Python API + + The following OpenVINO Python API is used in the application: + + +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+ + | Feature | API | Description | + +==========================================+==============================================================================================================================================================+====================================================================================+ + | Model Operations | `openvino.runtime.Model `__ , | Managing of model | + | | `openvino.runtime.set_batch `__ , | | + | | `openvino.runtime.Model.input `__ | | + +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+ + | Opset operations | `openvino.runtime.op.Parameter `__ , | Description of a model topology using OpenVINO Python API | + | | `openvino.runtime.op.Constant `__ , | | + | | `openvino.runtime.opset8.convolution `__ , | | + | | `openvino.runtime.opset8.add `__ , | | + | | `openvino.runtime.opset1.max_pool `__ , | | + | | `openvino.runtime.opset8.reshape `__ , | | + | | `openvino.runtime.opset8.matmul `__ , | | + | | `openvino.runtime.opset8.relu `__ , | | + | | `openvino.runtime.opset8.softmax `__ | | + +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python* Sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/model_creation_sample/model_creation_sample.py + :language: python How It Works ############ @@ -54,7 +65,6 @@ At startup, the sample application does the following: - Loads the model and input data to the OpenVINO™ Runtime plugin - Performs synchronous inference and processes output data, logging each step in a standard output stream - You can see the explicit description of each sample step at :doc:`Integration Steps ` section of "Integrate OpenVINO™ Runtime with Your Application" guide. Running diff --git a/samples/python/speech_sample/README.md b/samples/python/speech_sample/README.md index 5a2176060ff..ba765f1e127 100644 --- a/samples/python/speech_sample/README.md +++ b/samples/python/speech_sample/README.md @@ -1,4 +1,4 @@ -# Automatic Speech Recognition Python* Sample {#openvino_inference_engine_ie_bridges_python_sample_speech_sample_README} +# Automatic Speech Recognition Python Sample {#openvino_inference_engine_ie_bridges_python_sample_speech_sample_README} @sphinxdirective @@ -12,38 +12,49 @@ This sample demonstrates how to do a Synchronous Inference of acoustic model bas The sample works with Kaldi ARK or Numpy* uncompressed NPZ files, so it does not cover an end-to-end speech recognition scenario (speech to text), requiring additional preprocessing (feature extraction) to get a feature vector from a speech signal, as well as postprocessing (decoding) to produce text from scores. -Automatic Speech Recognition Python sample application demonstrates how to use the following Python API in applications: +.. tab-set:: -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ -| Feature | API | Description | -+===================================================================+================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================+=======================================================================+ -| Import/Export Model | `openvino.runtime.Core.import_model `__ , `openvino.runtime.CompiledModel.export_model `__ | The GNA plugin supports loading and saving of the GNA-optimized model | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ -| Model Operations | `openvino.runtime.Model.add_outputs `__ , `openvino.runtime.set_batch `__ , `openvino.runtime.CompiledModel.inputs `__ , `openvino.runtime.CompiledModel.outputs `__ , `openvino.runtime.ConstOutput.any_name `__ | Managing of model: configure batch_size, input and output tensors | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ -| Synchronous Infer | `openvino.runtime.CompiledModel.create_infer_request `__ , `openvino.runtime.InferRequest.infer `__ | Do synchronous inference | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ -| InferRequest Operations | `openvino.runtime.InferRequest.get_input_tensor `__ , `openvino.runtime.InferRequest.model_outputs `__ , `openvino.runtime.InferRequest.model_inputs `__ , | Get info about model using infer request API | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ -| InferRequest Operations | `openvino.runtime.InferRequest.query_state `__ , `openvino.runtime.VariableState.reset `__ | Gets and resets CompiledModel state control | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ -| Profiling | `openvino.runtime.InferRequest.profiling_info `__ , `openvino.runtime.ProfilingInfo.real_time `__ | Get infer request profiling info | -+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + .. tab-item:: Requirements -Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python* Sample `. + +----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Options | Values | + +======================================================================+======================================================================================================================================================================+ + | Validated Models | Acoustic model based on Kaldi* neural models (see :ref:`Model Preparation ` section) | + +----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin) | + +----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Supported devices | See :ref:`Execution Modes ` section below and :doc:`List Supported Devices ` | + +----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Other language realization | :doc:`C++ ` | + +----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -+----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Options | Values | -+======================================================================+======================================================================================================================================================================+ -| Validated Models | Acoustic model based on Kaldi* neural models (see :ref:`Model Preparation ` section) | -+----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Model Format | OpenVINO™ toolkit Intermediate Representation (.xml + .bin) | -+----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Supported devices | See :ref:`Execution Modes ` section below and :doc:`List Supported Devices ` | -+----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Other language realization | :doc:`C++ ` | -+----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + .. tab-item:: Python API + + Automatic Speech Recognition Python sample application demonstrates how to use the following Python API in applications: + + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + | Feature | API | Description | + +===================================================================+================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================+=======================================================================+ + | Import/Export Model | `openvino.runtime.Core.import_model `__ , `openvino.runtime.CompiledModel.export_model `__ | The GNA plugin supports loading and saving of the GNA-optimized model | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + | Model Operations | `openvino.runtime.Model.add_outputs `__ , `openvino.runtime.set_batch `__ , `openvino.runtime.CompiledModel.inputs `__ , `openvino.runtime.CompiledModel.outputs `__ , `openvino.runtime.ConstOutput.any_name `__ | Managing of model: configure batch_size, input and output tensors | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + | Synchronous Infer | `openvino.runtime.CompiledModel.create_infer_request `__ , `openvino.runtime.InferRequest.infer `__ | Do synchronous inference | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + | InferRequest Operations | `openvino.runtime.InferRequest.get_input_tensor `__ , `openvino.runtime.InferRequest.model_outputs `__ , `openvino.runtime.InferRequest.model_inputs `__ , | Get info about model using infer request API | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + | InferRequest Operations | `openvino.runtime.InferRequest.query_state `__ , `openvino.runtime.VariableState.reset `__ | Gets and resets CompiledModel state control | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + | Profiling | `openvino.runtime.InferRequest.profiling_info `__ , `openvino.runtime.ProfilingInfo.real_time `__ | Get infer request profiling info | + +-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------+ + + Basic OpenVINO™ Runtime API is covered by :doc:`Hello Classification Python* Sample `. + + .. tab-item:: Sample Code + + .. doxygensnippet:: samples/python/speech_sample/speech_sample.py + :language: python How It Works ############ @@ -53,6 +64,7 @@ At startup, the sample application reads command-line parameters, loads a specif You can see the explicit description of each sample step at :doc:`Integration Steps ` section of "Integrate OpenVINO™ Runtime with Your Application" guide. + GNA-specific details ####################