Compare commits

...

64 Commits

Author SHA1 Message Date
Maxim Kurin
d56d921409
[Hetero] Update pre processing info (#4127)
* [Hetero] Update layout in inputs info

* Azure CI: set testdata branch for Mac

Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2021-02-11 16:00:03 +03:00
Mikhail Kozlov
e17f43922e
[Compile-tool] Fix write output blob for Windows to release (#4132)
* Fix write output blob for Windows.

* Refactoring

* Azure CI: set testdata branch for Mac

Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2021-02-11 15:59:42 +03:00
Artemy Skrebkov
aa23fbb9d3
Update benchmark_app to pass precision and layout via command line (#4167)
* Move processing ins and outs into samples/common

    - To re-use it in compile_tool and benchmark_app

* Extract common into samples_utils lib

    - To re-use it in samples and tools

* Move processLayout into samples_utils

* Clean up

* Enable warning as errors for samples_utils

* Cannot set precision or layout for compiled network

* Remove layout setting for benchmark_app

  - It requires further discussion

* Fix compilation of samples

* Fix one more sample

* Fix windows build

* Update README.md

* One more fix for windows

* Fix OpenVino ONNX CI build

* More build fixes

* Move os and vpu common into utils

* Fix build for myriad tools

* Fix windows build

* Export gflags
2021-02-11 15:53:19 +03:00
azhogov
8690aac494 Azure CI: Remove fake ONNX CI 2021-02-10 17:51:32 +03:00
azhogov
783af1e5ae Azure CI: Sync with master 2021-02-10 17:34:19 +03:00
Andrey Somsikov
8396e6473e
Switch to OpenCV 4.5.1 (#4006) 2021-01-27 11:09:51 +03:00
Alexander Perepelkin
1eeaad3c82
Fix virtual inheritance for class PadLayerTest (#3914) 2021-01-20 15:17:29 +03:00
Dmitry Budnikov
c4ac476d2a
fluid update (#3625) 2020-12-16 12:11:02 +03:00
Mikhail Kozlov
ed6e329774
Rename KMB to VPUX (#3591) 2020-12-15 06:59:55 +03:00
Nikita Kudriavtsev
fb1536f2be
[IE VPUX][cherry pick #3001] Part of changes: Visitor API deserialization for ops from opset1 (#3558) 2020-12-11 18:06:58 +03:00
Alina Alborova
39447e08e7
Cherry-pick #2922 into releases/2021/2 (#3495)
* Checrry-pick GNA doc review

* Addressed comments

* Removed an inexistent link
2020-12-07 17:41:13 +03:00
Maksim Shabunin
176bdf5137
Restored gtk-3 installation (#3472) 2020-12-04 18:36:11 +03:00
Ilya Lavrenov
f730bf9ae9
Restore compilaltion with tbb 2017u7 (#3007) (#3426)
* Restore compilaltion with tbb 2017u7

Signed-off-by: Alexander Peskov <alexander.peskov@intel.com>

* Fix unsupported arg for tbb deterministic_reduce

Signed-off-by: Alexander Peskov <alexander.peskov@intel.com>

Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>

Co-authored-by: Alexander Peskov <alexander.peskov@intel.com>
Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2020-12-02 16:43:06 +03:00
Ilya Lavrenov
422127e33d
API changes updates for 2021.2 (#3419) 2020-12-01 06:27:32 +03:00
Evgeny Lazarev
1e1eafe09d
Removed confusing information about required/optional output of the operation. The output exists always but it may be not connected to anywhere. (#3422) 2020-11-30 19:56:11 +03:00
Maksim Doronin
d2e3e1fc00
[IE][VPU]: Mish decomposition (#3412)
Introduce vpu ngraph transformation that decomposes Mish layer with the following formula: mish(x) = x * tanh(ln(exp(x) + 1)). It is needed to fix the accuracy drop of Yolo-v4 public model that happened due to Mish implementation in the myriad plugin is not accurate enough. It is just a workaround and will be removed when Mish layer will be improved.
map: 70.97% (ref: 70.96%)
coco_precision: 73.50% (ref 73.49%)
2020-11-30 18:51:51 +03:00
Vitaliy Urusovskij
2a57c7bbe4
Fix paths for squeezenet1.1 in time_tests config (#3417) 2020-11-30 18:45:15 +03:00
Evgenya Stepyreva
10274c0908
[DOC] ShapeInference.md update. slyalin comments (#3355)
* [DOC] ShapeInference.md update. slyalin comments

* Apply suggestions from code review

Co-authored-by: Alina Alborova <alina.alborova@intel.com>

* Apply suggestions from code review

Co-authored-by: Alina Alborova <alina.alborova@intel.com>

* Update docs/IE_DG/ShapeInference.md

Co-authored-by: Alina Alborova <alina.alborova@intel.com>
2020-11-30 16:39:58 +03:00
Gleb Kazantaev
cb71090389
Updated transformations API guide (#3386)
* Updated transformations docs

* Added RTTI to examples

* Fixed grammar mistakes

* Mention Sinks in NG docs
2020-11-30 13:50:30 +03:00
Alexey Suhov
0335cdbbc6
[install_prerequisites.sh] upgrade pip to install tensorflow (#3392) (#3402) 2020-11-27 18:35:28 +03:00
Andrey Dmitriev
ff878ffe92
[GNA] Fix import model with header version 2.1 (#3363) 2020-11-27 17:01:59 +03:00
Maksim Doronin
8f507a07f5
[IE][VPU]: Use unified pcie firmware (#3383)
* Unified firmware named pcie-ma2x8x is needed to use both ma2480 and ma2085 with pcie connection.
* Update firmware built from R14 release branch
2020-11-27 15:25:37 +03:00
Jedrzej Hajduczenia
a09de25dd2
[IE CLDNN] Fix handling of fsv4 input padding in mmad bfyx to fsv32 convolution kernel (#3253) 2020-11-27 13:41:13 +03:00
Nikolay Shchegolev
86f96a8f3a
[CPU] NMS test for the rest of 1st & 2nd outputs. (#3380) 2020-11-27 13:21:52 +03:00
Alexander Peskov
6966e383d3
Cherry-pick from master (#3379)
* [DOC] Add macOS specific section into intro guide

Signed-off-by: Peskov <alexander.peskov@intel.com>

* Remove libinference_engine_legacy from 'must link with' section

Signed-off-by: Peskov <alexander.peskov@intel.com>
2020-11-26 19:37:00 +03:00
Maksim Doronin
ab1a3e8d84
[IE][VPU]: KW fixes 2021.2 (#3313) 2020-11-26 17:00:29 +03:00
Ilya Lavrenov
29d9462a9b
Fixes for documentation build (#3365) 2020-11-26 14:32:33 +03:00
Gladilov, Gleb
c067ed1b9a
[IE][VPU]: Introduces ENABLE_EARLY_ELTWISE_RELU_FUSION option (#3343)
Unconditional Eltwise+ReLU merge makes some models take a bit more memory,
so they could not be inferred on Myriad-X. With this change used can
optionally disable this optimization and use Myriad-X.
2020-11-26 13:27:53 +03:00
Andrey Zaytsev
bff2fe0b2f
Cherry-pick #3295 to releases/2021/2 (#3353)
* Feature/azaytsev/change layout (#3295)

* Updated openvino_docs.xml
2020-11-25 18:08:22 +03:00
Tomasz Dołbniak
fd532c2611
Fix the potential unlimited mem allocation problem (#3347) 2020-11-25 17:41:25 +03:00
Vitaliy Urusovskij
1d68caf96f
Add WA for OMZ Keras models in stress tests (#3341) 2020-11-25 14:38:15 +03:00
Vitaliy Urusovskij
7bd3738afd
Add fillBlobs to fix issue with negative values in image_info input layer (#3335) 2020-11-25 14:37:21 +03:00
Vladimir Gavrilov
5767a54fa2
Fixes for NMS documentation. (#3305)
* Fixes for NMS documentation.

* Small fixes.

* Small fix.
2020-11-25 14:05:14 +03:00
Ilya Lavrenov
56326a3d2d
Fixed klockwork for legacy library (#3320) 2020-11-25 11:14:55 +03:00
Evgenya Stepyreva
1baf72a780
[ DOC ] setBatchSize update (#3316)
* [ DOC ] setBatchSize update

* comments

* Links fixed

* Update docs/IE_DG/ShapeInference.md

* Fixing broken note

* Fixing broken note [2]

* Update docs/IE_DG/ShapeInference.md

Co-authored-by: Alina Alborova <alina.alborova@intel.com>

Co-authored-by: Alina Alborova <alina.alborova@intel.com>
2020-11-24 20:56:27 +03:00
Artyom Anokhov
c22e65e8a6
[Scripts] install_NEO_OCL_driver: Updated capturing '-y' option. Removed installing prerequisites. (#3322)
* install_NEO_OCL_driver: Updated capturing '-y' option. Removed installing prerequisites.

* install_NEO_OCL_driver: Rollback removing install_prerequisites, but keep only ocl-icd & libnuma dependencies. Updated definition of UBUNTU_VERSION.
2020-11-24 20:20:21 +03:00
Anton Voronov
3964168205
[CPU] fixed MergePermuteAndReorder optimization (#3317) 2020-11-24 19:14:30 +03:00
Piotr Rozen
a416a80c86
Fixed KW issues reported for build 754 of speech recognition demo (#3326) 2020-11-24 18:15:45 +03:00
Elizaveta Lobanova
81152e07f3
[GNA] Fix a global buffer overflow in GNAModelSerial::Import (#3290) (#3327) 2020-11-24 18:12:16 +03:00
Krishna Prabhakaran
a14fdef9b6
[IE][VPU]: Update call signature with the fw from R14 develop branch (#3241)
* Update call signature with the firmware from mdk R14 branch
* Update VPU firmware build number
2020-11-24 16:22:56 +03:00
Ilya Lavrenov
ce3bea3c07
Fixed links to build instruction (#3309) 2020-11-24 13:12:22 +03:00
Svetlana Dolinina
707a0833d8
added state API changes to doc (#3307) 2020-11-24 12:17:37 +03:00
Vitaliy Urusovskij
71cde81827
Align time_tests models with master (#3270)
* Add new model to `tgl_test_config.yml` (#3236)

* Fix wrong path for `yolo-v2-tiny-ava-0001` for time_tests

* Add several new models to `tgl_test_config.yml` in time_tests
2020-11-24 11:06:37 +03:00
Artyom Anokhov
f4ed2572a5
[Scripts] Update install_NEO_OCL_driver with 20.35.17767 for 2021.2 (#3288)
* install_NEO_OCL_driver: Added new CLI options. Added help. Added new available to download and install driver - 20.35.17767

* install_NEO_OCL_driver: Fixed descriptions and var names

* install_NEO_OCL_driver: Updated syntax
2020-11-23 21:11:27 +03:00
Maxim Andronov
ec02bc4dbd
Fixed static analysis issues (transformations) (#3276) 2020-11-23 17:08:54 +03:00
Edward Shogulin
5a05e52d40
[LPT] integration: issue #42391 & issue #43001 (#3201)
* [LPT] NetworkHelper::roundWithTolerance: removed tolerance & rename to round
[LPT] NetworkHelper::round functional tests
[LPT] ieFuncTests: updated some test-cases

* [LPT] Subtract is not used

* [LPT] AddTransformation: zero handling

* [LPT] AddTransformation test
2020-11-23 17:08:41 +03:00
Sergey Shlyapnikov
fee727f415
[IE CLDNN] Gather fix (#3282) 2020-11-23 16:40:17 +03:00
Maxim Andronov
01c3951887
Fixed static analysis issues (#3254) 2020-11-22 20:42:53 +03:00
Nikolay Shchegolev
7715d033d2
[CPU] NormalizeL2. Support 3D layout. (#3256) 2020-11-22 20:18:33 +03:00
Nikolay Shchegolev
1da3539bc1
[CPU] NMS. Fill the rest of first out blob. (#3251) 2020-11-22 20:06:15 +03:00
Ivan Tikhonov
ec8527f21e
fix for sliced input, fix for reshaping of Loop op (squash commits) (#3261) 2020-11-22 13:25:04 +03:00
Evgenya Stepyreva
1c35875a60
[ MO ] Fix for preprocessing insertion on ShapeOf paths (#3233)
* [ MO ] Fix for preprocessing insertion on ShapeOf paths

* ScaleInput tests
2020-11-20 16:25:11 +03:00
Vladimir Paramuzov
1e392b0180
[IE CLDNN] Minor fixed to NMS and TopK (#3224) 2020-11-20 15:37:32 +03:00
Evgenya Stepyreva
a05b7c76b2
[ nG: TI ] Fix for reshaping TensorIterator (#3237)
* [ nG: TI ] Fix for reshaping TensorIterator

* Trigger CI

* misprint

* style

* style
2020-11-20 15:22:19 +03:00
Vitaliy Urusovskij
3a9c731c2b
Fix "results" uploading to DB in time_tests (#3214) 2020-11-20 13:25:37 +03:00
Roman Kazantsev
641f1425df
Complete CTCGreedyDecoder implementation in nGraph and add tests (#3206)
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-11-20 11:05:45 +03:00
iliya mironov
e67dffa6a3
Update tf2 yolov4 docs support (#3227)
Co-authored-by: Your Name <you@example.com>
2020-11-20 09:24:14 +03:00
Evgenya Stepyreva
7b85eef15f
[ MO TF ] TF FakeQuantize normalization fix (#3180) 2020-11-19 18:38:20 +03:00
Dmitrii Denisov
ea0f6fce5a
Update install_openvino_dependencies.sh (#3196) 2020-11-19 17:38:44 +03:00
Vladislav Golubev
6959f6671f
[LPT] Transpose, MatMul: Klocwork fixes (#3192) 2020-11-19 15:15:39 +03:00
Gleb Kazantaev
322bc3498b
Fix NMS1/3/4 to Legacy conversion (#3210)
* Fix NMS1/3/4 to Legacy conversion

* Added functoinal tests
2020-11-19 14:20:32 +03:00
Andrey Sokolov
6effe67358
[IE] - Interpolate ONNX workaround (#3203)
Co-authored-by: DariaMityagina <daria.mityagina@intel.com>
2020-11-19 11:59:46 +03:00
Tomasz Jankowski
759c91d547
Backport of PR #3092 - TopK sorting fix (#3195) 2020-11-19 11:40:45 +03:00
Ilya Churaev
5abbe2fec5
Disable v10 serealizer (#3184)
* Disable v10 serealizer

* Fixed comments
2020-11-19 11:34:59 +03:00
482 changed files with 23301 additions and 3892 deletions

View File

@ -4,13 +4,13 @@ jobs:
timeoutInMinutes: 90
pool:
name: LIN_VMSS_VENV_F8S_WU2
name: LIN_VMSS_VENV_F16S_WU2
variables:
system.debug: true
VSTS_HTTP_RETRY: 5
VSTS_HTTP_TIMEOUT: 200
WORKERS_NUMBER: 8
WORKERS_NUMBER: 16
BUILD_TYPE: Release
REPO_DIR: $(Build.Repository.LocalPath)
WORK_DIR: $(Pipeline.Workspace)/_w
@ -22,11 +22,10 @@ jobs:
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
whoami
uname -a
which python3
python3 --version
which java
java -version
gcc --version
echo Python3 info ; which python3 ; python3 --version
echo Python info ; which python ; python --version
echo Java info ; which java ; java -version
echo gcc info ; which gcc ; gcc --version
lsb_release
env
cat /proc/cpuinfo
@ -35,6 +34,7 @@ jobs:
vmstat -s
df
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
free -h
displayName: 'System info'
- script: |

View File

@ -1,95 +0,0 @@
jobs:
- job: nGraph_ONNX_Lin
# About 150% of total time
timeoutInMinutes: 60
pool:
name: LIN_VMSS_VENV_F8S_WU2
variables:
system.debug: true
VSTS_HTTP_RETRY: 5
VSTS_HTTP_TIMEOUT: 200
WORKERS_NUMBER: 8
BUILD_TYPE: Release
REPO_DIR: $(Build.Repository.LocalPath)
WORK_DIR: $(Pipeline.Workspace)/_w
BUILD_DIR: $(WORK_DIR)/build
BIN_DIR: $(REPO_DIR)/bin/intel64/$(BUILD_TYPE)
INSTALL_DIR: $(WORK_DIR)/install
steps:
- checkout: self
clean: true
lfs: false
submodules: recursive
path: openvino
- script: |
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
whoami
uname -a
which python3
python3 --version
gcc --version
lsb_release
env
cat /proc/cpuinfo
cat /proc/meminfo
vmstat -s
df
displayName: 'System info'
- script: |
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
displayName: 'Make dir'
- script: |
sudo apt --assume-yes install libusb-1.0-0-dev
python3 -m pip install -r ./inference-engine/ie_bridges/python/requirements.txt
# For running Python API tests
python3 -m pip install -r ./inference-engine/ie_bridges/python/src/requirements-dev.txt
displayName: 'Install dependencies'
enabled: false
- script: |
wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
unzip ninja-linux.zip
sudo cp -v ninja /usr/local/bin/
workingDirectory: $(WORK_DIR)
displayName: 'Install Ninja'
enabled: false
- task: CMake@1
inputs:
# CMake must get Python 3.x version by default
cmakeArgs: -GNinja -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_VPU=OFF -DENABLE_GNA=OFF -DENABLE_OPENCV=OFF -DENABLE_CPPLINT=OFF -DENABLE_TESTS=OFF -DENABLE_BEH_TESTS=OFF -DENABLE_FUNCTIONAL_TESTS=OFF -DENABLE_MKL_DNN=ON -DENABLE_CLDNN=OFF -DENABLE_PROFILING_ITT=OFF -DENABLE_SAMPLES=OFF -DENABLE_SPEECH_DEMO=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python3.6 -DNGRAPH_ONNX_IMPORT_ENABLE=ON -DNGRAPH_INTERPRETER_ENABLE=ON -DNGRAPH_DEBUG_ENABLE=OFF -DNGRAPH_DYNAMIC_COMPONENTS_ENABLE=ON -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) $(REPO_DIR)
workingDirectory: $(BUILD_DIR)
enabled: false
- script: ninja
workingDirectory: $(BUILD_DIR)
displayName: 'Build'
enabled: false
- script: make install
workingDirectory: $(BUILD_DIR)
displayName: 'Install'
enabled: false
- script: |
ls -alR $(REPO_DIR)/bin/
ls -alR $(INSTALL_DIR)
displayName: 'List files'
enabled: false
- script: docker build --tag=openvino-onnx-ci-image --file=$(REPO_DIR)/.ci/openvino-onnx/Dockerfile .
workingDirectory: $(BUILD_DIR)
displayName: 'Docker build'
enabled: false
- script: docker run --name openvino-onnx-ci-container openvino-onnx-ci-image
workingDirectory: $(BUILD_DIR)
displayName: 'Docker run tests'
enabled: false

View File

@ -111,7 +111,7 @@ jobs:
continueOnError: false
- script: |
git clone https://github.com/openvinotoolkit/testdata.git
git clone --single-branch --branch releases/2021/2 https://github.com/openvinotoolkit/testdata.git
workingDirectory: $(WORK_DIR)
displayName: 'Clone testdata'

View File

@ -53,16 +53,11 @@ jobs:
displayName: 'Install dependencies'
- script: |
certutil -urlcache -split -f https://incredibuilddiag1wu2.blob.core.windows.net/incredibuild/IBSetupConsole_9_5_0.exe IBSetupConsole_9_5_0.exe
call IBSetupConsole_9_5_0.exe /Install /Components=Agent,oneuse /Coordinator=11.1.0.4 /AGENT:OPENFIREWALL=ON /AGENT:AUTOSELECTPORTS=ON /ADDTOPATH=ON /AGENT:INSTALLADDINS=OFF
certutil -urlcache -split -f https://incredibuilddiag1wu2.blob.core.windows.net/incredibuild/install_ib_console.bat install_ib_console.bat
call install_ib_console.bat
workingDirectory: $(WORK_DIR)
displayName: 'Install IncrediBuild'
- script: |
echo Stop IncrediBuild_Agent && net stop IncrediBuild_Agent
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Xoreax\IncrediBuild\Builder /f /v LastEnabled /d 0 && echo Start IncrediBuild_Agent && net start IncrediBuild_Agent
displayName: 'Start IncrediBuild'
- script: |
set PATH=$(WORK_DIR)\ninja-win;%PATH%
call "$(MSVS_VARS_PATH)" && cmake -GNinja -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
@ -78,6 +73,7 @@ jobs:
- script: echo Stop IncrediBuild_Agent && net stop IncrediBuild_Agent
displayName: Stop IncrediBuild
continueOnError: true
- script: dir $(REPO_DIR)\bin\ /s
displayName: 'List files'
@ -149,7 +145,7 @@ jobs:
# Add for gtest-parallel, it hangs now (CVS-33386)
#python $(BUILD_DIR)\gtest-parallel\gtest-parallel $(BIN_DIR)\MklDnnFunctionalTests --workers=$(WORKERS_NUMBER) --dump_json_test_results=MklDnnFunctionalTests.json --gtest_filter=*smoke* -- --gtest_print_time=1
- script: |
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;$(REPO_DIR)\inference-engine\temp\opencv_4.5.0\opencv\bin;%PATH%
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;$(REPO_DIR)\inference-engine\temp\opencv_4.5.1\opencv\bin;%PATH%
set DATA_PATH=$(BUILD_DIR)\testdata
set MODELS_PATH=$(BUILD_DIR)\testdata
$(BIN_DIR)\MklDnnFunctionalTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:TEST-MklDnnFunctionalTests.xml
@ -157,7 +153,7 @@ jobs:
continueOnError: false
- script: |
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;$(REPO_DIR)\inference-engine\temp\opencv_4.5.0\opencv\bin;%PATH%
set PATH=$(REPO_DIR)\inference-engine\temp\tbb\bin;$(REPO_DIR)\inference-engine\temp\opencv_4.5.1\opencv\bin;%PATH%
set DATA_PATH=$(BUILD_DIR)\testdata
set MODELS_PATH=$(BUILD_DIR)\testdata
$(BIN_DIR)\InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml

View File

@ -132,14 +132,6 @@ function(build_docs)
COMMAND ${Python3_EXECUTABLE} ${PYX_FILTER} ${PYTHON_API_OUT}
COMMENT "Pre-process Python API")
# Plugin API
add_custom_target(plugin_api
COMMAND ${DOXYGEN_EXECUTABLE} ${PLUGIN_CONFIG_BINARY}
WORKING_DIRECTORY ${DOCS_BINARY_DIR}
COMMENT "Generating Plugin API Reference"
VERBATIM)
# Preprocess docs
add_custom_target(preprocess_docs
@ -165,6 +157,15 @@ function(build_docs)
WORKING_DIRECTORY ${DOCS_BINARY_DIR}
VERBATIM)
# Plugin API
add_custom_target(plugin_api
DEPENDS ie_docs
COMMAND ${DOXYGEN_EXECUTABLE} ${PLUGIN_CONFIG_BINARY}
WORKING_DIRECTORY ${DOCS_BINARY_DIR}
COMMENT "Generating Plugin API Reference"
VERBATIM)
# Umbrella OpenVINO target
add_custom_target(openvino_docs

View File

@ -2,6 +2,29 @@
The sections below contain detailed list of changes made to the Inference Engine API in recent releases.
## 2021.2
### New API
**State API**
* InferenceEngine::InferRequest::QueryState query state value of network on current infer request
* InferenceEngine::IVariableState class instead of IMemoryState (rename)
* InferenceEngine::IVariableState::GetState instead of IMemoryState::GetLastState (rename)
**BatchedBlob** - represents a InferenceEngine::BatchedBlob containing other blobs - one per batch.
**Transformations API** - added a new header `ie_transformations.hpp` which contains transformations for InferenceEngine::CNNNetwork object. Such transformations can be called prior to loading network for compilation for particular device:
* InferenceEngine::LowLatency
### Deprecated API
**State API**
* InferenceEngine::ExecutableNetwork::QueryState - use InferenceEngine::InferRequest::QueryState
* InferenceEngine::IVariableState::GetLastState - use InferenceEngine::IVariableState::GetState
## 2021.1
### Deprecated API

View File

@ -20,7 +20,7 @@ There are two ways to check if CPU device can support bfloat16 computations for
1. Query the instruction set via system `lscpu | grep avx512_bf16` or `cat /proc/cpuinfo | grep avx512_bf16`.
2. Use [Query API](InferenceEngine_QueryAPI.md) with `METRIC_KEY(OPTIMIZATION_CAPABILITIES)`, which should return `BF16` in the list of CPU optimization options:
@snippet openvino/docs/snippets/Bfloat16Inference0.cpp part0
@snippet snippets/Bfloat16Inference0.cpp part0
Current Inference Engine solution for bfloat16 inference uses Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN) and supports inference of the following layers in BF16 computation mode:
* Convolution
@ -46,11 +46,11 @@ Bfloat16 data usage provides the following benefits that increase performance:
For default optimization on CPU, source model converts from FP32 or FP16 to BF16 and executes internally on platforms with native BF16 support. In that case, `KEY_ENFORCE_BF16` is set to `YES`.
The code below demonstrates how to check if the key is set:
@snippet openvino/docs/snippets/Bfloat16Inference1.cpp part1
@snippet snippets/Bfloat16Inference1.cpp part1
To disable BF16 internal transformations, set the `KEY_ENFORCE_BF16` to `NO`. In this case, the model infers AS IS without modifications with precisions that were set on each layer edge.
@snippet openvino/docs/snippets/Bfloat16Inference2.cpp part2
@snippet snippets/Bfloat16Inference2.cpp part2
An exception with message `Platform doesn't support BF16 format` is formed in case of setting `KEY_ENFORCE_BF16` to `YES` on CPU without native BF16 support.

View File

@ -18,7 +18,7 @@ The batch size that was set in passed <code>CNNNetwork</code> object will be use
Here is a code example:
@snippet openvino/docs/snippets/DynamicBatching.cpp part0
@snippet snippets/DynamicBatching.cpp part0
## Limitations

View File

@ -20,7 +20,7 @@ To add your custom nGraph operation, create a new class that extends `ngraph::Op
Based on that, declaration of a operation class can look as follows:
@snippet op.hpp op:header
@snippet template_extension/op.hpp op:header
### Class Fields
@ -33,37 +33,37 @@ The provided implementation has several fields:
nGraph operation contains two constructors: a default constructor, which allows to create operation without attributes and a constructor that creates and validates operation with specified inputs and attributes.
@snippet op.cpp op:ctor
@snippet template_extension/op.cpp op:ctor
### `validate_and_infer_types()`
`ngraph::Node::validate_and_infer_types` method validates operation attributes and calculates output shapes using attributes of operation.
@snippet op.cpp op:validate
@snippet template_extension/op.cpp op:validate
### `clone_with_new_inputs()`
`ngraph::Node::clone_with_new_inputs` method creates a copy of nGraph operation with new inputs.
@snippet op.cpp op:copy
@snippet template_extension/op.cpp op:copy
### `visit_attributes()`
`ngraph::Node::visit_attributes` method allows to visit all operation attributes.
@snippet op.cpp op:visit_attributes
@snippet template_extension/op.cpp op:visit_attributes
### `evaluate()`
`ngraph::Node::evaluate` method allows to apply constant folding to an operation.
@snippet op.cpp op:evaluate
@snippet template_extension/op.cpp op:evaluate
## Register Custom Operations in Extension Class
To add custom operations to the [Extension](Extension.md) class, create an operation set with custom operations and implement the `InferenceEngine::IExtension::getOpSets` method:
@snippet extension.cpp extension:getOpSets
@snippet template_extension/extension.cpp extension:getOpSets
This method returns a map of opsets that exist in the extension library.

View File

@ -7,7 +7,7 @@ The primary vehicle for the performance of the CPU codepath in the Inference Eng
All custom kernels for the CPU plugin should be inherited from the InferenceEngine::ILayerExecImpl interface.
Based on that, declaration of a kernel implementation class can look as follows:
@snippet cpu_kernel.hpp cpu_implementation:header
@snippet template_extension/cpu_kernel.hpp cpu_implementation:header
### Class Fields
@ -22,25 +22,25 @@ The provided implementation has several fields:
An implementation constructor checks parameters of nGraph operation, stores needed attributes, and stores an error message in the case of an error.
@snippet cpu_kernel.cpp cpu_implementation:ctor
@snippet template_extension/cpu_kernel.cpp cpu_implementation:ctor
### `getSupportedConfigurations`
InferenceEngine::ILayerExecImpl::getSupportedConfigurations method returns all supported configuration formats (input/output tensor layouts) for your implementation. To specify formats of data, use InferenceEngine::TensorDesc. Refer to the [Memory Primitives](../Memory_primitives.md) section for instructions on how to do it.
@snippet cpu_kernel.cpp cpu_implementation:getSupportedConfigurations
@snippet template_extension/cpu_kernel.cpp cpu_implementation:getSupportedConfigurations
### `init`
InferenceEngine::ILayerExecImpl::init method gets a runtime-selected configuration from a vector that is populated from the `getSupportedConfigurations` method and checks the parameters:
@snippet cpu_kernel.cpp cpu_implementation:init
@snippet template_extension/cpu_kernel.cpp cpu_implementation:init
### `execute`
InferenceEngine::ILayerExecImpl::execute method accepts and processes the actual tenors as input/output blobs:
@snippet cpu_kernel.cpp cpu_implementation:execute
@snippet template_extension/cpu_kernel.cpp cpu_implementation:execute
## Register Implementation in `Extension` Class
@ -52,18 +52,18 @@ To register custom kernel implementation in the [Extension](Extension.md) class,
InferenceEngine::IExtension::getImplTypes returns a vector of implementation types for an operation.
@snippet extension.cpp extension:getImplTypes
@snippet template_extension/extension.cpp extension:getImplTypes
### <a name="getImplementation"><code>getImplementation</code></a>
InferenceEngine::IExtension::getImplementation returns the kernel implementation with a specified type for an operation.
@snippet extension.cpp extension:getImplementation
@snippet template_extension/extension.cpp extension:getImplementation
## Load Extension with Executable Kernels to Plugin
Use the `AddExtension` method of the general plugin interface to load your primitives:
@snippet openvino/docs/snippets/CPU_Kernel.cpp part0
@snippet snippets/CPU_Kernel.cpp part0

View File

@ -38,12 +38,12 @@ If operator is no longer needed, it can be unregistered by calling `unregister_o
The same principles apply when registering custom ONNX operator based on custom nGraph operations.
This example shows how to register custom ONNX operator based on `Operation` presented in [this tutorial](AddingNGraphOps.md), which is used in [TemplateExtension](Extension.md).
@snippet extension.cpp extension:ctor
@snippet template_extension/extension.cpp extension:ctor
Here, the `register_operator` function is called in Extension's constructor, which makes sure that it is called before InferenceEngine::Core::ReadNetwork (since InferenceEngine::Core::AddExtension must be called before a model with custom operator is read).
The example below demonstrates how to unregister operator from Extension's destructor:
@snippet extension.cpp extension:dtor
@snippet template_extension/extension.cpp extension:dtor
Note that it is mandatory to unregister custom ONNX operator if it is defined in dynamic shared library.
## Requirements for building with CMake

View File

@ -5,11 +5,11 @@ All extension libraries should be inherited from this interface.
Based on that, declaration of an extension class can look as follows:
@snippet extension.hpp extension:header
@snippet template_extension/extension.hpp extension:header
The extension library should contain and export the method InferenceEngine::CreateExtension, which creates an `Extension` class:
@snippet extension.cpp extension:CreateExtension
@snippet template_extension/extension.cpp extension:CreateExtension
Also, an `Extension` object should implement the following methods:
@ -17,7 +17,7 @@ Also, an `Extension` object should implement the following methods:
* InferenceEngine::IExtension::GetVersion returns information about version of the library
@snippet extension.cpp extension:GetVersion
@snippet template_extension/extension.cpp extension:GetVersion
Implement the InferenceEngine::IExtension::getOpSets method if the extension contains custom layers.
Read the [guide about custom operations](AddingNGraphOps.md) for more information.

View File

@ -7,7 +7,7 @@ There are two options of using custom layer configuration file:
* Include a section with your kernels into the global automatically-loaded `cldnn_global_custom_kernels/cldnn_global_custom_kernels.xml` file, which is hosted in the `<INSTALL_DIR>/deployment_tools/inference_engine/bin/intel64/{Debug/Release}` folder
* Call the `InferenceEngine::Core::SetConfig()` method from your application with the `InferenceEngine::PluginConfigParams::KEY_CONFIG_FILE` key and the configuration file name as a value before loading the network that uses custom layers to the plugin:
@snippet openvino/docs/snippets/GPU_Kernel.cpp part0
@snippet snippets/GPU_Kernel.cpp part0
All Inference Engine samples, except trivial `hello_classification`,
feature a dedicated command-line option `-c` to load custom kernels. For example, to load custom layers for the classification sample, run the command below:
@ -227,7 +227,7 @@ floating-point, and integer kernel parameters. To get the dump, add the
following line to your code that configures the GPU plugin to output the
custom kernels:
@snippet openvino/docs/snippets/GPU_Kernel.cpp part1
@snippet snippets/GPU_Kernel.cpp part1
When the Inference Engine compiles the kernels for the specific network,
it also outputs the resulting code for the custom kernels. In the

View File

@ -30,7 +30,7 @@ File with tuned data is the result of this step.
The example below shows how to set and use the key files:
@snippet openvino/docs/snippets/GPU_Kernels_Tuning.cpp part0
@snippet snippets/GPU_Kernels_Tuning.cpp part0
---

View File

@ -72,7 +72,7 @@ Glossary of terms used in the Inference Engine
| <code>InferenceEngineProfileInfo</code> | Represents basic inference profiling information per layer |
| Inference Engine | A C++ library with a set of classes that you can use in your application to infer input data (images) and get the result |
| Inference Engine API | The basic default API for all supported devices, which allows you to load a model from Intermediate Representation, set input and output formats and execute the model on various devices |
| Inference Engine <code>Core<code> | Inference Engine Core is a software component that manages inference on certain Intel(R) hardware devices: CPU, GPU, MYRIAD, GNA, etc. |
| Inference Engine <code>Core</code> | Inference Engine Core is a software component that manages inference on certain Intel(R) hardware devices: CPU, GPU, MYRIAD, GNA, etc. |
| Layer catalog or Operations specification | A list of supported layers or operations and its parameters. Sets of supported layers are different for different plugins, please check the documentation on plugins to verify if the Inference Engine supports certain layer on the dedicated hardware |
| <code>Layout</code> | Image data layout refers to the representation of images batch. Layout shows a sequence of 4D or 5D tensor data in memory. A typical NCHW format represents pixel in horizontal direction, rows by vertical dimension, planes by channel and images into batch |
| <code>OutputsDataMap</code> | Structure which contains information about output precisions and layouts |

View File

@ -23,7 +23,7 @@ The `InferenceEngine::ExecutableNetwork` class is also extended to support the Q
### GetAvailableDevices
@snippet openvino/docs/snippets/InferenceEngine_QueryAPI0.cpp part0
@snippet snippets/InferenceEngine_QueryAPI0.cpp part0
The function returns list of available devices, for example:
```
@ -46,7 +46,7 @@ Each device name can then be passed to:
The code below demonstrates how to understand whether `HETERO` device dumps `.dot` files with split graphs during the split stage:
@snippet openvino/docs/snippets/InferenceEngine_QueryAPI1.cpp part1
@snippet snippets/InferenceEngine_QueryAPI1.cpp part1
For documentation about common configuration keys, refer to `ie_plugin_config.hpp`. Device specific configuration keys can be found in corresponding plugin folders.
@ -54,7 +54,7 @@ For documentation about common configuration keys, refer to `ie_plugin_config.hp
* To extract device properties such as available device, device name, supported configuration keys, and others, use the `InferenceEngine::Core::GetMetric` method:
@snippet openvino/docs/snippets/InferenceEngine_QueryAPI2.cpp part2
@snippet snippets/InferenceEngine_QueryAPI2.cpp part2
A returned value looks as follows: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz`.
@ -66,17 +66,17 @@ A returned value looks as follows: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz`.
The method is used to get executable network specific metric such as `METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS)`:
@snippet openvino/docs/snippets/InferenceEngine_QueryAPI3.cpp part3
@snippet snippets/InferenceEngine_QueryAPI3.cpp part3
Or the current temperature of `MYRIAD` device:
@snippet openvino/docs/snippets/InferenceEngine_QueryAPI4.cpp part4
@snippet snippets/InferenceEngine_QueryAPI4.cpp part4
### GetConfig()
The method is used to get information about configuration values the executable network has been created with:
@snippet openvino/docs/snippets/InferenceEngine_QueryAPI5.cpp part5
@snippet snippets/InferenceEngine_QueryAPI5.cpp part5
### SetConfig()

View File

@ -29,20 +29,20 @@ Integration process includes the following steps:
1) **Create Inference Engine Core** to manage available devices and read network objects:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part0
@snippet snippets/Integrate_with_customer_application_new_API.cpp part0
2) **Read a model IR** created by the Model Optimizer (.xml is supported format):
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part1
@snippet snippets/Integrate_with_customer_application_new_API.cpp part1
**Or read the model from ONNX format** (.onnx and .prototxt are supported formats). You can find more information about the ONNX format support in the document [ONNX format support in the OpenVINO™](./ONNX_Support.md).
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part2
@snippet snippets/Integrate_with_customer_application_new_API.cpp part2
3) **Configure input and output**. Request input and output information using `InferenceEngine::CNNNetwork::getInputsInfo()`, and `InferenceEngine::CNNNetwork::getOutputsInfo()`
methods:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part3
@snippet snippets/Integrate_with_customer_application_new_API.cpp part3
Optionally, set the number format (precision) and memory layout for inputs and outputs. Refer to the
[Supported configurations](supported_plugins/Supported_Devices.md) chapter to choose the relevant configuration.
@ -67,7 +67,7 @@ methods:
You can use the following code snippet to configure input and output:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part4
@snippet snippets/Integrate_with_customer_application_new_API.cpp part4
> **NOTE**: NV12 input color format pre-processing differs from other color conversions. In case of NV12,
> Inference Engine expects two separate image planes (Y and UV). You must use a specific
@ -91,31 +91,31 @@ methods:
4) **Load the model** to the device using `InferenceEngine::Core::LoadNetwork()`:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part5
@snippet snippets/Integrate_with_customer_application_new_API.cpp part5
It creates an executable network from a network object. The executable network is associated with single hardware device.
It is possible to create as many networks as needed and to use them simultaneously (up to the limitation of the hardware resources).
Third parameter is a configuration for plugin. It is map of pairs: (parameter name, parameter value). Choose device from
[Supported devices](supported_plugins/Supported_Devices.md) page for more details about supported configuration parameters.
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part6
@snippet snippets/Integrate_with_customer_application_new_API.cpp part6
5) **Create an infer request**:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part7
@snippet snippets/Integrate_with_customer_application_new_API.cpp part7
6) **Prepare input**. You can use one of the following options to prepare input:
* **Optimal way for a single network.** Get blobs allocated by an infer request using `InferenceEngine::InferRequest::GetBlob()`
and feed an image and the input data to the blobs. In this case, input data must be aligned (resized manually) with a
given blob size and have a correct color format.
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part8
@snippet snippets/Integrate_with_customer_application_new_API.cpp part8
* **Optimal way for a cascade of networks (output of one network is input for another).** Get output blob from the first
request using `InferenceEngine::InferRequest::GetBlob()` and set it as input for the second request using
`InferenceEngine::InferRequest::SetBlob()`.
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part9
@snippet snippets/Integrate_with_customer_application_new_API.cpp part9
* **Optimal way to handle ROI (a ROI object located inside of input of one network is input for another).** It is
possible to re-use shared input by several networks. You do not need to allocate separate input blob for a network if
@ -126,7 +126,7 @@ methods:
ROI without allocation of new memory using `InferenceEngine::make_shared_blob()` with passing of
`InferenceEngine::Blob::Ptr` and `InferenceEngine::ROI` as parameters.
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part10
@snippet snippets/Integrate_with_customer_application_new_API.cpp part10
Make sure that shared input is kept valid during execution of each network. Otherwise, ROI blob may be corrupted if the
original input blob (that ROI is cropped from) has already been rewritten.
@ -134,7 +134,7 @@ methods:
* Allocate input blobs of the appropriate types and sizes, feed an image and the input data to the blobs, and call
`InferenceEngine::InferRequest::SetBlob()` to set these blobs for an infer request:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part11
@snippet snippets/Integrate_with_customer_application_new_API.cpp part11
A blob can be filled before and after `SetBlob()`.
@ -157,11 +157,11 @@ methods:
7) **Do inference** by calling the `InferenceEngine::InferRequest::StartAsync` and `InferenceEngine::InferRequest::Wait`
methods for asynchronous request:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part12
@snippet snippets/Integrate_with_customer_application_new_API.cpp part12
or by calling the `InferenceEngine::InferRequest::Infer` method for synchronous request:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part13
@snippet snippets/Integrate_with_customer_application_new_API.cpp part13
`StartAsync` returns immediately and starts inference without blocking main thread, `Infer` blocks
main thread and returns when inference is completed.
@ -185,7 +185,7 @@ exception.
Note that casting `Blob` to `TBlob` via `std::dynamic_pointer_cast` is not recommended way,
better to access data via `buffer()` and `as()` methods as follows:
@snippet openvino/docs/snippets/Integrate_with_customer_application_new_API.cpp part14
@snippet snippets/Integrate_with_customer_application_new_API.cpp part14
## Build Your Application

View File

@ -116,7 +116,7 @@ For Intel® Distribution of OpenVINO™ toolkit, the Inference Engine package co
[sample console applications](Samples_Overview.md) demonstrating how you can use
the Inference Engine in your applications.
The open source version is available in the [OpenVINO™ toolkit GitHub repository](https://github.com/openvinotoolkit/openvino) and can be built for supported platforms using the <a href="https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md">Inference Engine Build Instructions</a>.
The open source version is available in the [OpenVINO™ toolkit GitHub repository](https://github.com/openvinotoolkit/openvino) and can be built for supported platforms using the <a href="https://github.com/openvinotoolkit/openvino/wiki/BuildingCode">Inference Engine Build Instructions</a>.
## See Also
- [Inference Engine Samples](Samples_Overview.md)
- [Intel&reg; Deep Learning Deployment Toolkit Web Page](https://software.intel.com/en-us/computer-vision-sdk)

View File

@ -27,44 +27,44 @@ Common migration process includes the following steps:
1. Migrate from the `InferenceEngine::InferencePlugin` initialization:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part0
@snippet snippets/Migration_CoreAPI.cpp part0
to the `InferenceEngine::Core` class initialization:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part1
@snippet snippets/Migration_CoreAPI.cpp part1
2. Instead of using `InferenceEngine::CNNNetReader` to read IR:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part2
@snippet snippets/Migration_CoreAPI.cpp part2
read networks using the Core class:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part3
@snippet snippets/Migration_CoreAPI.cpp part3
The Core class also allows reading models from the ONNX format (more information is [here](./ONNX_Support.md)):
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part4
@snippet snippets/Migration_CoreAPI.cpp part4
3. Instead of adding CPU device extensions to the plugin:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part5
@snippet snippets/Migration_CoreAPI.cpp part5
add extensions to CPU device using the Core class:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part6
@snippet snippets/Migration_CoreAPI.cpp part6
4. Instead of setting configuration keys to a particular plugin, set (key, value) pairs via `InferenceEngine::Core::SetConfig`
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part7
@snippet snippets/Migration_CoreAPI.cpp part7
> **NOTE**: If `deviceName` is omitted as the last argument, configuration is set for all Inference Engine devices.
5. Migrate from loading the network to a particular plugin:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part8
@snippet snippets/Migration_CoreAPI.cpp part8
to `InferenceEngine::Core::LoadNetwork` to a particular device:
@snippet openvino/docs/snippets/Migration_CoreAPI.cpp part9
@snippet snippets/Migration_CoreAPI.cpp part9
After you have an instance of `InferenceEngine::ExecutableNetwork`, all other steps are as usual.

View File

@ -18,7 +18,7 @@ Two categories of API functions:
To list all supported ONNX ops in a specific version and domain, use the `get_supported_operators`
as shown in the example below:
@snippet openvino/docs/snippets/OnnxImporterTutorial0.cpp part0
@snippet snippets/OnnxImporterTutorial0.cpp part0
The above code produces a list of all the supported operators for the `version` and `domain` you specified and outputs a list similar to this:
```cpp
@ -30,7 +30,7 @@ Xor
To determine whether a specific ONNX operator in a particular version and domain is supported by the importer, use the `is_operator_supported` function as shown in the example below:
@snippet openvino/docs/snippets/OnnxImporterTutorial1.cpp part1
@snippet snippets/OnnxImporterTutorial1.cpp part1
## Import ONNX Model
@ -55,13 +55,13 @@ As it was shown in [Build a Model with nGraph Library](../nGraph_DG/build_functi
The code below shows how to convert the ONNX ResNet50 model to the nGraph function using `import_onnx_model` with the stream as an input:
@snippet openvino/docs/snippets/OnnxImporterTutorial2.cpp part2
@snippet snippets/OnnxImporterTutorial2.cpp part2
### <a name="path">Filepath as Input</a>
The code below shows how to convert the ONNX ResNet50 model to the nGraph function using `import_onnx_model` with the filepath as an input:
@snippet openvino/docs/snippets/OnnxImporterTutorial3.cpp part3
@snippet snippets/OnnxImporterTutorial3.cpp part3
[onnx_header]: https://github.com/NervanaSystems/ngraph/blob/master/src/ngraph/frontend/onnx_import/onnx.hpp
[onnx_model_zoo]: https://github.com/onnx/models

View File

@ -53,7 +53,7 @@ The officially supported Linux* build environment is the following:
* GCC* 7.5.0 (for Ubuntu* 18.04) or GCC* 4.8.5 (for CentOS* 7.6)
* CMake* version 3.10 or higher
> **NOTE**: For building samples from the open-source version of OpenVINO™ toolkit, see the [build instructions on GitHub](https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md).
> **NOTE**: For building samples from the open-source version of OpenVINO™ toolkit, see the [build instructions on GitHub](https://github.com/openvinotoolkit/openvino/wiki/BuildingCode).
To build the C or C++ sample applications for Linux, go to the `<INSTALL_DIR>/inference_engine/samples/c` or `<INSTALL_DIR>/inference_engine/samples/cpp` directory, respectively, and run the `build_samples.sh` script:
```sh

View File

@ -1,6 +1,36 @@
Using Shape Inference {#openvino_docs_IE_DG_ShapeInference}
==========================================
OpenVINO™ provides the following methods for runtime model reshaping:
* **Set a new input shape** with the `InferenceEngine::CNNNetwork::reshape` method.<br>
The `InferenceEngine::CNNNetwork::reshape` method updates input shapes and propagates them down to the outputs of the model through all intermediate layers.
> **NOTES**:
> - Starting with the 2021.1 release, the Model Optimizer converts topologies keeping shape-calculating sub-graphs by default, which enables correct shape propagation during reshaping in most cases.
> - Older versions of IRs are not guaranteed to reshape successfully. Please regenerate them with the Model Optimizer of the latest version of OpenVINO™.<br>
> - If an ONNX model does not have a fully defined input shape and the model was imported with the ONNX importer, reshape the model before loading it to the plugin.
* **Set a new batch dimension value** with the `InferenceEngine::CNNNetwork::setBatchSize` method.<br>
The meaning of a model batch may vary depending on the model design.
This method does not deduce batch placement for inputs from the model architecture.
It assumes that the batch is placed at the zero index in the shape for all inputs and uses the `InferenceEngine::CNNNetwork::reshape` method to propagate updated shapes through the model.
The method transforms the model before a new shape propagation to relax a hard-coded batch dimension in the model, if any.
Use `InferenceEngine::CNNNetwork::reshape` instead of `InferenceEngine::CNNNetwork::setBatchSize` to set new input shapes for the model in case the model has:
* Multiple inputs with different zero-index dimension meanings
* Input without a batch dimension
* 0D, 1D, or 3D shape
The `InferenceEngine::CNNNetwork::setBatchSize` method is a high-level API method that wraps the `InferenceEngine::CNNNetwork::reshape` method call and works for trivial models from the batch placement standpoint.
Use `InferenceEngine::CNNNetwork::reshape` for other models.
Using the `InferenceEngine::CNNNetwork::setBatchSize` method for models with a non-zero index batch placement or for models with inputs that do not have a batch dimension may lead to undefined behaviour.
You can change input shapes multiple times using the `InferenceEngine::CNNNetwork::reshape` and `InferenceEngine::CNNNetwork::setBatchSize` methods in any order.
If a model has a hard-coded batch dimension, use `InferenceEngine::CNNNetwork::setBatchSize` first to change the batch, then call `InferenceEngine::CNNNetwork::reshape` to update other dimensions, if needed.
Inference Engine takes three kinds of a model description as an input, which are converted into an `InferenceEngine::CNNNetwork` object:
1. [Intermediate Representation (IR)](../MO_DG/IR_and_opsets.md) through `InferenceEngine::Core::ReadNetwork`
2. [ONNX model](../IE_DG/OnnxImporterTutorial.md) through `InferenceEngine::Core::ReadNetwork`
@ -23,33 +53,7 @@ for (const auto & parameter : parameters) {
To feed input data of a shape that is different from the model input shape, reshape the model first.
OpenVINO™ provides the following methods for runtime model reshaping:
* **Set a new input shape** with the `InferenceEngine::CNNNetwork::reshape` method.<br>
The `InferenceEngine::CNNNetwork::reshape` method updates input shapes and propagates them down to the outputs of the model through all intermediate layers.
You can reshape a model multiple times like in this application scheme:
```
ReadNetwork -> reshape(input_1_shape) -> LoadNetwork -> infer(input_1)
\
-> reshape(input_2_shape) -> LoadNetwork -> infer(input_2)
```
> **NOTES**:
> - Starting with the 2021.1 release, the Model Optimizer converts topologies keeping shape-calculating sub-graphs by default, which enables correct shape propagation during reshaping.
> - Older versions of IRs are not guaranteed to reshape successfully. Please regenerate them with the Model Optimizer of the latest version of OpenVINO™.<br>
> - If an ONNX model does not have a fully defined input shape and the model was imported with the ONNX importer, reshape the model before loading it to the plugin.
* **Set a new batch dimension value** with the `InferenceEngine::CNNNetwork::setBatchSize` method.<br>
The meaning of a model batch may vary depending on the model design.
The `InferenceEngine::CNNNetwork::setBatchSize` method deduces the index of a batch dimension based only on the input rank.
This method does not work for models with a non-zero index batch placement or models with inputs without a batch dimension.
The batch-setting algorithm does not involve the shape inference mechanism.
Batch of input and output shapes for all layers is set to a new batch value without layer validation.
It may cause both positive and negative side effects.
Due to the limitations described above, the current method is not recommended to use.
If you need to set a new batch size for the model, use the `CNNNetwork::reshape` method instead.
Do not use runtime reshaping methods simultaneously, especially do not call the `CNNNetwork::reshape` method after you use `InferenceEngine::CNNNetwork::setBatchSize`.
The `InferenceEngine::CNNNetwork::setBatchSize` method causes irreversible conversion of the internal model representation into the legacy model representation.
The method does not use nGraph for shape inference which leads to reduced reshape opportunities and may affect the performance of the model.
Once the input shape of `InferenceEngine::CNNNetwork` is set, call the `InferenceEngine::Core::LoadNetwork` method to get an `InferenceEngine::ExecutableNetwork` object for inference with updated shapes.
There are other approaches to reshape the model during the stage of <a href="_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html#when_to_specify_input_shapes">IR generation</a> or [nGraph::Function creation](../nGraph_DG/build_function.md).
@ -62,8 +66,8 @@ Shape collision during shape propagation may be a sign that a new shape does not
Changing the model input shape may result in intermediate operations shape collision.
Examples of such operations:
- <a href="_docs_MO_DG_prepare_model_convert_model_IR_V10_opset1.html#Reshape">`Reshape` operation</a> with a hard-coded output shape value
- <a href="_docs_MO_DG_prepare_model_convert_model_IR_V10_opset1.html#MatMul">`MatMul` operation</a> with the `Const` second input cannot be resized by spatial dimensions due to operation semantics
- [`Reshape` operation](../ops/shape/Reshape_1.md) with a hard-coded output shape value
- [`MatMul` operation](../ops/matrix/MatMul_1.md) with the `Const` second input cannot be resized by spatial dimensions due to operation semantics
Model structure and logic should not change significantly after model reshaping.
- The Global Pooling operation is commonly used to reduce output feature map of classification models output.
@ -94,7 +98,7 @@ The algorithm for resizing network is the following:
Here is a code example:
@snippet openvino/docs/snippets/ShapeInference.cpp part0
@snippet snippets/ShapeInference.cpp part0
Shape Inference feature is used in [Smart classroom sample](@ref omz_demos_smart_classroom_demo_README).

View File

@ -7,26 +7,26 @@ Inference Engine is a set of C++ libraries providing a common API to deliver inf
For Intel® Distribution of OpenVINO™ toolkit, Inference Engine binaries are delivered within release packages.
The open source version is available in the [OpenVINO™ toolkit GitHub repository](https://github.com/openvinotoolkit/openvino) and can be built for supported platforms using the <a href="https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md">Inference Engine Build Instructions</a>.
The open source version is available in the [OpenVINO™ toolkit GitHub repository](https://github.com/openvinotoolkit/openvino) and can be built for supported platforms using the <a href="https://github.com/openvinotoolkit/openvino/wiki/BuildingCode">Inference Engine Build Instructions</a>.
To learn about how to use the Inference Engine API for your application, see the [Integrating Inference Engine in Your Application](Integrate_with_customer_application_new_API.md) documentation.
For complete API Reference, see the [API Reference](usergroup29.html) section.
For complete API Reference, see the [Inference Engine API References](./api_references.html) section.
Inference Engine uses a plugin architecture. Inference Engine plugin is a software component that contains complete implementation for inference on a certain Intel&reg; hardware device: CPU, GPU, VPU, etc. Each plugin implements the unified API and provides additional hardware-specific APIs.
Modules in the Inference Engine component
---------------------------------------
-----------------------------------------
### Core Inference Engine Libraries ###
Your application must link to the core Inference Engine libraries:
* Linux* OS:
- `libinference_engine.so`, which depends on `libinference_engine_transformations.so` and `libngraph.so`
- `libinference_engine_legacy.so`, which depends on `libtbb.so`
- `libinference_engine.so`, which depends on `libinference_engine_transformations.so`, `libtbb.so`, `libtbbmalloc.so` and `libngraph.so`
* Windows* OS:
- `inference_engine.dll`, which depends on `inference_engine_transformations.dll` and `ngraph.dll`
- `inference_engine_legacy.dll`, which depends on `tbb.dll`
- `inference_engine.dll`, which depends on `inference_engine_transformations.dll`, `tbb.dll`, `tbbmalloc.dll` and `ngraph.dll`
* macOS*:
- `libinference_engine.dylib`, which depends on `libinference_engine_transformations.dylib`, `libtbb.dylib`, `libtbbmalloc.dylib` and `libngraph.dylib`
The required C++ header files are located in the `include` directory.
@ -49,26 +49,26 @@ Starting from 2020.4 release, Inference Engine introduced a concept of `CNNNetwo
For each supported target device, Inference Engine provides a plugin — a DLL/shared library that contains complete implementation for inference on this particular device. The following plugins are available:
| Plugin | Device Type |
| ------------- | ------------- |
|CPU| Intel® Xeon® with Intel® AVX2 and AVX512, Intel® Core™ Processors with Intel® AVX2, Intel® Atom® Processors with Intel® SSE |
|GPU| Intel® Processor Graphics, including Intel® HD Graphics and Intel® Iris® Graphics
|MYRIAD| Intel® Neural Compute Stick 2 powered by the Intel® Movidius™ Myriad™ X|
|GNA| Intel&reg; Speech Enabling Developer Kit, Amazon Alexa* Premium Far-Field Developer Kit, Intel&reg; Pentium&reg; Silver J5005 Processor, Intel&reg; Pentium&reg; Silver N5000 Processor, Intel&reg; Celeron&reg; J4005 Processor, Intel&reg; Celeron&reg; J4105 Processor, Intel&reg; Celeron&reg; Processor N4100, Intel&reg; Celeron&reg; Processor N4000, Intel&reg; Core&trade; i3-8121U Processor, Intel&reg; Core&trade; i7-1065G7 Processor, Intel&reg; Core&trade; i7-1060G7 Processor, Intel&reg; Core&trade; i5-1035G4 Processor, Intel&reg; Core&trade; i5-1035G7 Processor, Intel&reg; Core&trade; i5-1035G1 Processor, Intel&reg; Core&trade; i5-1030G7 Processor, Intel&reg; Core&trade; i5-1030G4 Processor, Intel&reg; Core&trade; i3-1005G1 Processor, Intel&reg; Core&trade; i3-1000G1 Processor, Intel&reg; Core&trade; i3-1000G4 Processor
|HETERO|Automatic splitting of a network inference between several devices (for example if a device doesn't support certain layers|
|MULTI| Simultaneous inference of the same network on several devices in parallel|
| Plugin | Device Type |
| ------- | ----------------------------- |
|CPU | Intel® Xeon® with Intel® AVX2 and AVX512, Intel® Core™ Processors with Intel® AVX2, Intel® Atom® Processors with Intel® SSE |
|GPU | Intel® Processor Graphics, including Intel® HD Graphics and Intel® Iris® Graphics |
|MYRIAD | Intel® Neural Compute Stick 2 powered by the Intel® Movidius™ Myriad™ X |
|GNA | Intel&reg; Speech Enabling Developer Kit, Amazon Alexa* Premium Far-Field Developer Kit, Intel&reg; Pentium&reg; Silver J5005 Processor, Intel&reg; Pentium&reg; Silver N5000 Processor, Intel&reg; Celeron&reg; J4005 Processor, Intel&reg; Celeron&reg; J4105 Processor, Intel&reg; Celeron&reg; Processor N4100, Intel&reg; Celeron&reg; Processor N4000, Intel&reg; Core&trade; i3-8121U Processor, Intel&reg; Core&trade; i7-1065G7 Processor, Intel&reg; Core&trade; i7-1060G7 Processor, Intel&reg; Core&trade; i5-1035G4 Processor, Intel&reg; Core&trade; i5-1035G7 Processor, Intel&reg; Core&trade; i5-1035G1 Processor, Intel&reg; Core&trade; i5-1030G7 Processor, Intel&reg; Core&trade; i5-1030G4 Processor, Intel&reg; Core&trade; i3-1005G1 Processor, Intel&reg; Core&trade; i3-1000G1 Processor, Intel&reg; Core&trade; i3-1000G4 Processor |
|HETERO | Automatic splitting of a network inference between several devices (for example if a device doesn't support certain layers|
|MULTI | Simultaneous inference of the same network on several devices in parallel|
The table below shows the plugin libraries and additional dependencies for Linux and Windows platforms.
The table below shows the plugin libraries and additional dependencies for Linux, Windows and macOS platforms.
| Plugin | Library name for Linux | Dependency libraries for Linux | Library name for Windows | Dependency libraries for Windows |
|--------|------------------------|-------------------------------------------------|--------------------------|--------------------------------------------------------------------------------------------------------|
| CPU | `libMKLDNNPlugin.so` | `libinference_engine_lp_transformations.so` | `MKLDNNPlugin.dll` | `inference_engine_lp_transformations.dll` |
| GPU | `libclDNNPlugin.so` | `libinference_engine_lp_transformations.so`, `libOpenCL.so` | `clDNNPlugin.dll` | `OpenCL.dll`, `inference_engine_lp_transformations.dll` |
| MYRIAD | `libmyriadPlugin.so` | `libusb.so`, `libinference_engine_lp_transformations.so` | `myriadPlugin.dll` | `usb.dll`, `inference_engine_lp_transformations.dll` |
| HDDL | `libHDDLPlugin.so` | `libbsl.so`, `libhddlapi.so`, `libmvnc-hddl.so`, `libinference_engine_lp_transformations.so`| `HDDLPlugin.dll` | `bsl.dll`, `hddlapi.dll`, `json-c.dll`, `libcrypto-1_1-x64.dll`, `libssl-1_1-x64.dll`, `mvnc-hddl.dll`, `inference_engine_lp_transformations.dll` |
| GNA | `libGNAPlugin.so` | `libgna.so`, `libinference_engine_lp_transformations.so` | `GNAPlugin.dll` | `gna.dll`, `inference_engine_lp_transformations.dll` |
| HETERO | `libHeteroPlugin.so` | Same as for selected plugins | `HeteroPlugin.dll` | Same as for selected plugins |
| MULTI | `libMultiDevicePlugin.so` | Same as for selected plugins | `MultiDevicePlugin.dll` | Same as for selected plugins |
| Plugin | Library name for Linux | Dependency libraries for Linux | Library name for Windows | Dependency libraries for Windows | Library name for macOS | Dependency libraries for macOS |
|--------|-----------------------------|-------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------------------------------|------------------------------|---------------------------------------------|
| CPU | `libMKLDNNPlugin.so` | `libinference_engine_lp_transformations.so` | `MKLDNNPlugin.dll` | `inference_engine_lp_transformations.dll` | `libMKLDNNPlugin.dylib` | `inference_engine_lp_transformations.dylib` |
| GPU | `libclDNNPlugin.so` | `libinference_engine_lp_transformations.so`, `libOpenCL.so` | `clDNNPlugin.dll` | `OpenCL.dll`, `inference_engine_lp_transformations.dll` | Is not supported | - |
| MYRIAD | `libmyriadPlugin.so` | `libusb.so`, | `myriadPlugin.dll` | `usb.dll` | `libmyriadPlugin.dylib` | `libusb.dylib` |
| HDDL | `libHDDLPlugin.so` | `libbsl.so`, `libhddlapi.so`, `libmvnc-hddl.so` | `HDDLPlugin.dll` | `bsl.dll`, `hddlapi.dll`, `json-c.dll`, `libcrypto-1_1-x64.dll`, `libssl-1_1-x64.dll`, `mvnc-hddl.dll` | Is not supported | - |
| GNA | `libGNAPlugin.so` | `libgna.so`, | `GNAPlugin.dll` | `gna.dll` | Is not supported | - |
| HETERO | `libHeteroPlugin.so` | Same as for selected plugins | `HeteroPlugin.dll` | Same as for selected plugins | `libHeteroPlugin.dylib` | Same as for selected plugins |
| MULTI | `libMultiDevicePlugin.so` | Same as for selected plugins | `MultiDevicePlugin.dll` | Same as for selected plugins | `libMultiDevicePlugin.dylib` | Same as for selected plugins |
> **NOTE**: All plugin libraries also depend on core Inference Engine libraries.
@ -76,15 +76,16 @@ Make sure those libraries are in your computer's path or in the place you pointe
* Linux: `LD_LIBRARY_PATH`
* Windows: `PATH`
* macOS: `DYLD_LIBRARY_PATH`
On Linux, use the script `bin/setupvars.sh` to set the environment variables.
On Linux and macOS, use the script `bin/setupvars.sh` to set the environment variables.
On Windows, run the `bin\setupvars.bat` batch file to set the environment variables.
To learn more about supported devices and corresponding plugins, see the [Supported Devices](supported_plugins/Supported_Devices.md) chapter.
Common Workflow for Using the Inference Engine API
---------------------------
--------------------------------------------------
The common workflow contains the following steps:
1. **Create Inference Engine Core object** - Create an `InferenceEngine::Core` object to work with different devices, all device plugins are managed internally by the `Core` object. Register extensions with custom nGraph operations (`InferenceEngine::Core::AddExtension`).

View File

@ -33,7 +33,7 @@ a temporary memory block for model decryption, and use
For more information, see the `InferenceEngine::Core` Class
Reference Documentation.
@snippet openvino/docs/snippets/protecting_model_guide.cpp part0
@snippet snippets/protecting_model_guide.cpp part0
Hardware-based protection, such as Intel&reg; Software Guard Extensions
(Intel&reg; SGX), can be utilized to protect decryption operation secrets and
@ -47,7 +47,7 @@ Currently there are no possibility to read external weights from memory for ONNX
The `ReadNetwork(const std::string& model, const Blob::CPtr& weights)` function
should be called with `weights` passed as an empty `Blob`.
@snippet openvino/docs/snippets/protecting_model_guide.cpp part1
@snippet snippets/protecting_model_guide.cpp part1
[deploy_encrypted_model]: img/deploy_encrypted_model.png
@ -57,7 +57,7 @@ should be called with `weights` passed as an empty `Blob`.
- OpenVINO™ toolkit online documentation: [https://docs.openvinotoolkit.org](https://docs.openvinotoolkit.org)
- Model Optimizer Developer Guide: [Model Optimizer Developer Guide](../MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md)
- Inference Engine Developer Guide: [Inference Engine Developer Guide](Deep_Learning_Inference_Engine_DevGuide.md)
- For more information on Sample Applications, see the [Inference Engine Samples Overview](Samples_Overview.html)
- For more information on Sample Applications, see the [Inference Engine Samples Overview](Samples_Overview.md)
- For information on a set of pre-trained models, see the [Overview of OpenVINO™ Toolkit Pre-Trained Models](@ref omz_models_intel_index)
- For information on Inference Engine Tutorials, see the [Inference Tutorials](https://github.com/intel-iot-devkit/inference-tutorials-generic)
- For IoT Libraries and Code Samples see the [Intel® IoT Developer Kit](https://github.com/intel-iot-devkit).

View File

@ -2,98 +2,98 @@
## Introducing the GNA Plugin
Intel&reg; Gaussian & Neural Accelerator is a low-power neural coprocessor for continuous inference at the edge.
Intel® Gaussian & Neural Accelerator is a low-power neural coprocessor for continuous inference at the edge.
Intel&reg; GNA is not intended to replace classic inference devices such as
CPU, graphics processing unit (GPU), or vision processing unit (VPU) . It is designed for offloading
Intel® GNA is not intended to replace classic inference devices such as
CPU, graphics processing unit (GPU), or vision processing unit (VPU). It is designed for offloading
continuous inference workloads including but not limited to noise reduction or speech recognition
to save power and free CPU resources.
The GNA plugin provides a way to run inference on Intel&reg; GNA, as well as in the software execution mode on CPU.
The GNA plugin provides a way to run inference on Intel® GNA, as well as in the software execution mode on CPU.
## Devices with Intel&reg; GNA
## Devices with Intel® GNA
Devices with Intel&reg; GNA support:
Devices with Intel® GNA support:
* [Intel&reg; Speech Enabling Developer Kit](https://www.intel.com/content/www/us/en/support/articles/000026156/boards-and-kits/smart-home.html)
* [Intel® Speech Enabling Developer Kit](https://www.intel.com/content/www/us/en/support/articles/000026156/boards-and-kits/smart-home.html)
* [Amazon Alexa* Premium Far-Field Developer Kit](https://developer.amazon.com/en-US/alexa/alexa-voice-service/dev-kits/amazon-premium-voice)
* [Amazon Alexa\* Premium Far-Field Developer Kit](https://developer.amazon.com/en-US/alexa/alexa-voice-service/dev-kits/amazon-premium-voice)
* [Intel&reg; Pentium&reg; Silver Processors N5xxx, J5xxx and Intel&reg; Celeron&reg; Processors N4xxx, J4xxx](https://ark.intel.com/content/www/us/en/ark/products/codename/83915/gemini-lake.html):
- Intel&reg; Pentium&reg; Silver J5005 Processor
- Intel&reg; Pentium&reg; Silver N5000 Processor
- Intel&reg; Celeron&reg; J4005 Processor
- Intel&reg; Celeron&reg; J4105 Processor
- Intel&reg; Celeron&reg; Processor N4100
- Intel&reg; Celeron&reg; Processor N4000
* [Intel® Pentium® Silver Processors N5xxx, J5xxx and Intel® Celeron® Processors N4xxx, J4xxx](https://ark.intel.com/content/www/us/en/ark/products/codename/83915/gemini-lake.html):
- Intel® Pentium® Silver J5005 Processor
- Intel® Pentium® Silver N5000 Processor
- Intel® Celeron® J4005 Processor
- Intel® Celeron® J4105 Processor
- Intel® Celeron® Processor N4100
- Intel® Celeron® Processor N4000
* [Intel&reg; Core&trade; Processors (formerly codenamed Cannon Lake)](https://ark.intel.com/content/www/us/en/ark/products/136863/intel-core-i3-8121u-processor-4m-cache-up-to-3-20-ghz.html):
Intel&reg; Core&trade; i3-8121U Processor
* [Intel® Core™ Processors (formerly codenamed Cannon Lake)](https://ark.intel.com/content/www/us/en/ark/products/136863/intel-core-i3-8121u-processor-4m-cache-up-to-3-20-ghz.html):
Intel® Core™ i3-8121U Processor
* [10th Generation Intel&reg; Core&trade; Processors (formerly codenamed Ice Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/74979/ice-lake.html):
- Intel&reg; Core&trade; i7-1065G7 Processor
- Intel&reg; Core&trade; i7-1060G7 Processor
- Intel&reg; Core&trade; i5-1035G4 Processor
- Intel&reg; Core&trade; i5-1035G7 Processor
- Intel&reg; Core&trade; i5-1035G1 Processor
- Intel&reg; Core&trade; i5-1030G7 Processor
- Intel&reg; Core&trade; i5-1030G4 Processor
- Intel&reg; Core&trade; i3-1005G1 Processor
- Intel&reg; Core&trade; i3-1000G1 Processor
- Intel&reg; Core&trade; i3-1000G4 Processor
* [10th Generation Intel® Core™ Processors (formerly codenamed Ice Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/74979/ice-lake.html):
- Intel® Core™ i7-1065G7 Processor
- Intel® Core™ i7-1060G7 Processor
- Intel® Core™ i5-1035G4 Processor
- Intel® Core™ i5-1035G7 Processor
- Intel® Core™ i5-1035G1 Processor
- Intel® Core™ i5-1030G7 Processor
- Intel® Core™ i5-1030G4 Processor
- Intel® Core™ i3-1005G1 Processor
- Intel® Core™ i3-1000G1 Processor
- Intel® Core™ i3-1000G4 Processor
* All [11th Generation Intel&reg; Core&trade; Processors (formerly codenamed Tiger Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/88759/tiger-lake.html).
* All [11th Generation Intel® Core™ Processors (formerly codenamed Tiger Lake)](https://ark.intel.com/content/www/us/en/ark/products/codename/88759/tiger-lake.html).
> **NOTE**: On platforms where Intel&reg; GNA is not enabled in the BIOS, the driver cannot be installed, so the GNA plugin uses the software emulation mode only.
> **NOTE**: On platforms where Intel® GNA is not enabled in the BIOS, the driver cannot be installed, so the GNA plugin uses the software emulation mode only.
## Drivers and Dependencies
Intel&reg; GNA hardware requires a driver to be installed on the system.
Intel® GNA hardware requires a driver to be installed on the system.
* Linux\* OS:
[Download Intel&reg; GNA driver for Ubuntu Linux 18.04.3 LTS (with HWE Kernel version 5.0+)](https://download.01.org/opencv/drivers/gna/)
[Download Intel® GNA driver for Ubuntu Linux 18.04.3 LTS (with HWE Kernel version 5.0+)](https://download.01.org/opencv/drivers/gna/)
* Windows\* OS:
Intel&reg; GNA driver for Windows is available through Windows Update\*
Intel® GNA driver for Windows is available through Windows Update\*
## Models and Layers Limitations
Because of specifics of hardware architecture, Intel&reg; GNA supports a limited set of layers, their kinds and combinations.
For example, you should not expect the GNA Plugin to be able to run computer vision models, except those specifically adapted for the GNA Plugin, because the plugin does not fully support
2D convolutions.
Because of specifics of hardware architecture, Intel® GNA supports a limited set of layers, their kinds and combinations.
For example, you should not expect the GNA Plugin to be able to run computer vision models, except those specifically adapted
for the GNA Plugin, because the plugin does not fully support 2D convolutions.
For the list of supported layers, see the **GNA** column of the **Supported Layers** section in [Supported Devices](Supported_Devices.md).
The list of supported layers can be found
[here](Supported_Devices.md) (see the GNA column of Supported Layers section).
Limitations include:
- Only 1D convolutions are natively supported in the models converted from:
- [Kaldi](../../MO_DG/prepare_model/convert_model/Convert_Model_From_Kaldi.md) framework;
- [TensorFlow](../../MO_DG/prepare_model/convert_model/Convert_Model_From_TensorFlow.md) framework; note that for TensorFlow models, the option `--disable_nhwc_to_nchw` must be used when running the Model Optimizer.
- The number of output channels for convolutions must be a multiple of 4
- Permute layer support is limited to the cases where no data reordering is needed, or when reordering is happening for 2 dimensions, at least one of which is not greater than 8
- [Kaldi](../../MO_DG/prepare_model/convert_model/Convert_Model_From_Kaldi.md) framework
- [TensorFlow](../../MO_DG/prepare_model/convert_model/Convert_Model_From_TensorFlow.md) framework. For TensorFlow models, use the `--disable_nhwc_to_nchw` option when running the Model Optimizer.
- The number of output channels for convolutions must be a multiple of 4.
- Permute layer support is limited to the cases where no data reordering is needed or when reordering is happening for two dimensions, at least one of which is not greater than 8.
#### Experimental Support for 2D Convolutions
The Intel&reg; GNA hardware natively supports only 1D convolution.
The Intel® GNA hardware natively supports only 1D convolution.
However, 2D convolutions can be mapped to 1D when a convolution kernel moves in a single direction. Such a transformation is performed by the GNA Plugin for Kaldi `nnet1` convolution. From this perspective, the Intel&reg; GNA hardware convolution operation accepts a `NHWC` input and produces `NHWC` output. Because OpenVINO&trade; only supports the `NCHW` layout, it may be necessary to insert `Permute` layers before or after convolutions.
However, 2D convolutions can be mapped to 1D when a convolution kernel moves in a single direction. GNA Plugin performs such a transformation for Kaldi `nnet1` convolution. From this perspective, the Intel® GNA hardware convolution operation accepts an `NHWC` input and produces an `NHWC` output. Because OpenVINO™ only supports the `NCHW` layout, you may need to insert `Permute` layers before or after convolutions.
For example, the Kaldi model optimizer inserts such a permute after convolution for the [rm_cnn4a network](https://download.01.org/openvinotoolkit/models_contrib/speech/kaldi/rm_cnn4a_smbr/). This `Permute` layer is automatically removed by the GNA Plugin, because the Intel&reg; GNA hardware convolution layer already produces the required `NHWC` result.
For example, the Kaldi model optimizer inserts such a permute after convolution for the [rm_cnn4a network](https://download.01.org/openvinotoolkit/models_contrib/speech/kaldi/rm_cnn4a_smbr/). This `Permute` layer is automatically removed by the GNA Plugin, because the Intel® GNA hardware convolution layer already produces the required `NHWC` result.
## Operation Precision
Intel&reg; GNA essentially operates in the low-precision mode, which represents a mix of 8-bit (`I8`), 16-bit (`I16`), and 32-bit (`I32`) integer computations, so compared to 32-bit floating point (`FP32`) results for example, calculated on CPU using Inference Engine [CPU Plugin](CPU.md) outputs calculated using reduced integer precision are different from the scores calculated using floating point.
Intel® GNA essentially operates in the low-precision mode, which represents a mix of 8-bit (`I8`), 16-bit (`I16`), and 32-bit (`I32`) integer computations. Outputs calculated using a reduced integer precision are different from the scores calculated using the floating point format, for example, `FP32` outputs calculated on CPU using the Inference Engine [CPU Plugin](CPU.md).
Unlike other plugins supporting low-precision execution, the GNA plugin calculates quantization factors at the model loading time, so a model can run without calibration.
Unlike other plugins supporting low-precision execution, the GNA plugin calculates quantization factors at the model loading time, so you can run a model without calibration.
## <a name="execution-models">Execution Modes</a>
## <a name="execution-modes">Execution Modes</a>
| Mode | Description |
| :---------------------------------| :---------------------------------------------------------|
| `GNA_AUTO` | Uses Intel&reg; GNA if available, otherwise uses software execution mode on CPU. |
| `GNA_HW` | Uses Intel&reg; GNA if available, otherwise raises an error. |
| `GNA_SW` | *Deprecated*. Executes the GNA-compiled graph on CPU performing calculations in the same precision as the Intel&reg; GNA, but not in the bit-exact mode. |
| `GNA_SW_EXACT` | Executes the GNA-compiled graph on CPU performing calculations in the same precision as the Intel&reg; GNA in the bit-exact mode. |
| `GNA_AUTO` | Uses Intel® GNA if available, otherwise uses software execution mode on CPU. |
| `GNA_HW` | Uses Intel® GNA if available, otherwise raises an error. |
| `GNA_SW` | *Deprecated*. Executes the GNA-compiled graph on CPU performing calculations in the same precision as the Intel® GNA, but not in the bit-exact mode. |
| `GNA_SW_EXACT` | Executes the GNA-compiled graph on CPU performing calculations in the same precision as the Intel® GNA in the bit-exact mode. |
| `GNA_SW_FP32` | Executes the GNA-compiled graph on CPU but substitutes parameters and calculations from low precision to floating point (`FP32`). |
## Supported Configuration Parameters
@ -101,42 +101,42 @@ Unlike other plugins supporting low-precision execution, the GNA plugin calculat
The plugin supports the configuration parameters listed below.
The parameters are passed as `std::map<std::string, std::string>` on `InferenceEngine::Core::LoadNetwork` or `InferenceEngine::SetConfig`.
The parameter `KEY_GNA_DEVICE_MODE` can also be changed at run time using `InferenceEngine::ExecutableNetwork::SetConfig` (for any values excluding `GNA_SW_FP32`). This allows switching the
You can change the `KEY_GNA_DEVICE_MODE` parameter at run time using `InferenceEngine::ExecutableNetwork::SetConfig`, which works for any value excluding `GNA_SW_FP32`. This enables you to switch the
execution between software emulation mode and hardware emulation mode after the model is loaded.
The parameter names below correspond to their usage through API keys, such as `GNAConfigParams::KEY_GNA_DEVICE_MODE` or `PluginConfigParams::KEY_PERF_COUNT`.
When specifying key values as raw strings (that is, when using Python API), omit the `KEY_` prefix.
When specifying key values as raw strings, that is, when using Python API, omit the `KEY_` prefix.
| Parameter Name | Parameter Values | Default Value | Description |
| :---------------------------------| :---------------------------------------------------------| :-----------| :------------------------------------------------------------------------|
| `KEY_GNA_COMPACT_MODE` | `YES`/`NO` | `NO` | Reuse I/O buffers to save space (makes debugging harder) |
| `KEY_GNA_SCALE_FACTOR` | `FP32` number | 1.0 | Scale factor to use for input quantization |
| `KEY_GNA_DEVICE_MODE` | `GNA_AUTO`/`GNA_HW`/`GNA_SW_EXACT`/`GNA_SW_FP32` | `GNA_AUTO` | One of the modes described <a name="execution-models">Execution Models</a> |
| `KEY_GNA_FIRMWARE_MODEL_IMAGE` | `std::string` | `""` | Name for embedded model binary dump file |
| `KEY_GNA_PRECISION` | `I16`/`I8` | `I16` | Hint to GNA plugin: preferred integer weight resolution for quantization |
| `KEY_PERF_COUNT` | `YES`/`NO` | `NO` | Turn on performance counters reporting |
| `KEY_GNA_LIB_N_THREADS` | 1-127 integer number | 1 | Sets the number of GNA accelerator library worker threads used for inference computation in software modes
| `KEY_GNA_COMPACT_MODE` | `YES`/`NO` | `YES` | Enables I/O buffers reuse to save space. Makes debugging harder. |
| `KEY_GNA_SCALE_FACTOR` | `FP32` number | 1.0 | Sets the scale factor to use for input quantization. |
| `KEY_GNA_DEVICE_MODE` | `GNA_AUTO`/`GNA_HW`/`GNA_SW_EXACT`/`GNA_SW_FP32` | `GNA_AUTO` | One of the modes described in <a href="#execution-modes">Execution Modes</a> |
| `KEY_GNA_FIRMWARE_MODEL_IMAGE` | `std::string` | `""` | Sets the name for the embedded model binary dump file. |
| `KEY_GNA_PRECISION` | `I16`/`I8` | `I16` | Sets the preferred integer weight resolution for quantization. |
| `KEY_PERF_COUNT` | `YES`/`NO` | `NO` | Turns on performance counters reporting. |
| `KEY_GNA_LIB_N_THREADS` | 1-127 integer number | 1 | Sets the number of GNA accelerator library worker threads used for inference computation in software modes.
## How to Interpret Performance Counters
As a result of collecting performance counters using `InferenceEngine::InferRequest::GetPerformanceCounts`, you can find various performance data about execution on GNA.
Returned map stores a counter description as a key, counter value is stored in the `realTime_uSec` field of the `InferenceEngineProfileInfo` structure. Current GNA implementation calculates counters for the whole utterance scoring and does not provide per-layer information. API allows to retrieve counter units in cycles, but they can be converted to seconds as follows:
Returned map stores a counter description as a key, and a counter value in the `realTime_uSec` field of the `InferenceEngineProfileInfo` structure. Current GNA implementation calculates counters for the whole utterance scoring and does not provide per-layer information. The API enables you to retrieve counter units in cycles, you can convert cycles to seconds as follows:
```
seconds = cycles / frequency
```
Refer to the table below to learn about the frequency of Intel&reg; GNA inside a particular processor.
Processor | Frequency of Intel&reg; GNA
Refer to the table below to learn about the frequency of Intel® GNA inside a particular processor.
Processor | Frequency of Intel® GNA
---|---
Intel&reg; Ice Lake processors| 400MHz
Intel&reg; Core&trade; i3-8121U processor| 400MHz
Intel&reg; Gemini Lake processors | 200MHz
Intel® Ice Lake processors| 400MHz
Intel® Core™ i3-8121U processor| 400MHz
Intel® Gemini Lake processors | 200MHz
Performance counters provided for the time being:
* Scoring request performance results
* Number of total cycles spent on scoring in hardware (including compute and memory stall cycles)
* Number of total cycles spent on scoring in hardware including compute and memory stall cycles
* Number of stall cycles spent in hardware
## Multithreading Support in GNA Plugin
@ -151,40 +151,40 @@ The GNA plugin supports the following configuration parameters for multithreadin
## Network Batch Size
Intel&reg; GNA plugin supports the processing of context-windowed speech frames in batches of 1-8 frames in one
Intel® GNA plugin supports the processing of context-windowed speech frames in batches of 1-8 frames in one
input blob using `InferenceEngine::ICNNNetwork::setBatchSize`. Increasing batch size only improves efficiency of `Fully Connected` layers.
> **NOTE**: For networks with `Convolutional`, `LSTM`, or `Memory` layers, the only supported batch size is 1.
## Compatibility with Heterogeneous Plugin
Heterogeneous plugin was tested with the Intel&reg; GNA as a primary device and CPU as a secondary device. To run inference of networks with layers unsupported by the GNA plugin (for example, Softmax), use the Heterogeneous plugin with the `HETERO:GNA,CPU` configuration. For the list of supported networks, see the [Supported Frameworks](#supported-frameworks).
Heterogeneous plugin was tested with the Intel® GNA as a primary device and CPU as a secondary device. To run inference of networks with layers unsupported by the GNA plugin, such as Softmax, use the Heterogeneous plugin with the `HETERO:GNA,CPU` configuration.
> **NOTE:** Due to limitation of the Intel&reg; GNA backend library, heterogeneous support is limited to cases where in the resulted sliced graph, only one subgraph is scheduled to run on GNA\_HW or GNA\_SW devices.
> **NOTE:** Due to limitation of the Intel® GNA backend library, heterogenous support is limited to cases where in the resulted sliced graph, only one subgraph is scheduled to run on GNA\_HW or GNA\_SW devices.
## Recovery from interruption by high-priority Windows audio processes\*
## Recovery from Interruption by High-Priority Windows Audio Processes\*
As noted in the introduction, GNA is designed for real-time workloads such as noise reduction.
GNA is designed for real-time workloads such as noise reduction.
For such workloads, processing should be time constrained, otherwise extra delays may cause undesired effects such as
audio "glitches". To make sure that processing can satisfy real time requirements, the GNA driver provides a QoS
(Quality of Service) mechanism which interrupts requests that might cause high-priority Windows audio processes to miss
schedule, thereby causing long running GNA tasks to terminate early.
*audio glitches*. To make sure that processing can satisfy real-time requirements, the GNA driver provides a Quality of Service
(QoS) mechanism, which interrupts requests that might cause high-priority Windows audio processes to miss
the schedule, thereby causing long running GNA tasks to terminate early.
Applications should be prepared for this situation.
If an inference (in `GNA_HW` mode) cannot be executed because of such an interruption, then `InferRequest::Wait()` will return status code
`StatusCode::INFER_NOT_STARTED` (note that it will be changed to a more meaningful status code in future releases).
If an inference in the `GNA_HW` mode cannot be executed because of such an interruption, then `InferRequest::Wait()` returns status code
`StatusCode::INFER_NOT_STARTED`. In future releases, it will be changed to a more meaningful status code.
Any application working with GNA must properly react if it receives this code. Various strategies are possible.
One of the options is to immediately switch to GNA SW emulation mode:
Any application working with GNA must properly react to this code.
One of the strategies to adapt an application:
1. Immediately switch to the GNA_SW emulation mode:
```cpp
std::map<std::string, Parameter> newConfig;
newConfig[GNAConfigParams::KEY_GNA_DEVICE_MODE] = Parameter("GNA_SW_EXACT");
executableNet.SetConfig(newConfig);
```
then resubmit and switch back to GNA_HW after some time hoping that the competing application has finished.
2. Resubmit and switch back to GNA_HW expecting that the competing application has finished.
## See Also

View File

@ -102,15 +102,15 @@ Refer to the sections below to see pseudo-code of usage examples.
This example uses the OpenCL context obtained from an executable network object.
@snippet openvino/docs/snippets/GPU_RemoteBlob_API0.cpp part0
@snippet snippets/GPU_RemoteBlob_API0.cpp part0
### Running GPU Plugin Inference within User-Supplied Shared Context
@snippet openvino/docs/snippets/GPU_RemoteBlob_API1.cpp part1
@snippet snippets/GPU_RemoteBlob_API1.cpp part1
### Direct Consuming of the NV12 VAAPI Video Decoder Surface on Linux
@snippet openvino/docs/snippets/GPU_RemoteBlob_API2.cpp part2
@snippet snippets/GPU_RemoteBlob_API2.cpp part2
## See Also

View File

@ -28,17 +28,17 @@ Default fallback policy decides which layer goes to which device automatically a
Another way to annotate a network is to set affinity manually using <code>ngraph::Node::get_rt_info</code> with key `"affinity"`:
@snippet openvino/docs/snippets/HETERO0.cpp part0
@snippet snippets/HETERO0.cpp part0
The fallback policy does not work if even one layer has an initialized affinity. The sequence should be calling of automating affinity settings and then fix manually.
> **NOTE**: If you set affinity manually, be careful at the current moment Inference Engine plugins don't support constant (`Constant`->`Result`) and empty (`Parameter`->`Result`) networks. Please avoid such subgraphs when you set affinity manually.
@snippet openvino/docs/snippets/HETERO1.cpp part1
@snippet snippets/HETERO1.cpp part1
If you rely on the default affinity distribution, you can avoid calling <code>InferenceEngine::Core::QueryNetwork</code> and just call <code>InferenceEngine::Core::LoadNetwork</code> instead:
@snippet openvino/docs/snippets/HETERO2.cpp part2
@snippet snippets/HETERO2.cpp part2
> **NOTE**: `InferenceEngine::Core::QueryNetwork` does not depend on affinities set by a user, but queries for layer support based on device capabilities.
@ -74,7 +74,7 @@ Heterogeneous plugin can generate two files:
* `hetero_affinity_<network name>.dot` - annotation of affinities per layer. This file is written to the disk only if default fallback policy was executed
* `hetero_subgraphs_<network name>.dot` - annotation of affinities per graph. This file is written to the disk during execution of <code>ICNNNetwork::LoadNetwork()</code> for heterogeneous plugin
@snippet openvino/docs/snippets/HETERO3.cpp part3
@snippet snippets/HETERO3.cpp part3
You can use GraphViz* utility or converters to `.png` formats. On Ubuntu* operating system, you can use the following utilities:
* `sudo apt-get install xdot`

View File

@ -32,11 +32,11 @@ You can use name of the configuration directly as a string, or use MultiDeviceCo
Basically, there are three ways to specify the devices to be use by the "MULTI":
@snippet openvino/docs/snippets/MULTI0.cpp part0
@snippet snippets/MULTI0.cpp part0
Notice that the priorities of the devices can be changed in real-time for the executable network:
@snippet openvino/docs/snippets/MULTI1.cpp part1
@snippet snippets/MULTI1.cpp part1
Finally, there is a way to specify number of requests that the multi-device will internally keep for each device.
Say if your original app was running 4 cameras with 4 inference requests now you would probably want to share these 4 requests between 2 devices used in the MULTI. The easiest way is to specify a number of requests for each device using parentheses: "MULTI:CPU(2),GPU(2)" and use the same 4 requests in your app. However, such an explicit configuration is not performance portable and hence not recommended. Instead, the better way is to configure the individual devices and query the resulting number of requests to be used in the application level (see [Configuring the Individual Devices and Creating the Multi-Device On Top](#configuring-the-individual-devices-and-creating-the-multi-device-on-top)).
@ -55,7 +55,7 @@ Available devices:
```
Simple programmatic way to enumerate the devices and use with the multi-device is as follows:
@snippet openvino/docs/snippets/MULTI2.cpp part2
@snippet snippets/MULTI2.cpp part2
Beyond trivial "CPU", "GPU", "HDDL" and so on, when multiple instances of a device are available the names are more qualified.
For example this is how two Intel® Movidius™ Myriad™ X sticks are listed with the hello_query_sample:
@ -68,13 +68,13 @@ For example this is how two Intel® Movidius™ Myriad™ X sticks are listed wi
So the explicit configuration to use both would be "MULTI:MYRIAD.1.2-ma2480,MYRIAD.1.4-ma2480".
Accordingly, the code that loops over all available devices of "MYRIAD" type only is below:
@snippet openvino/docs/snippets/MULTI3.cpp part3
@snippet snippets/MULTI3.cpp part3
## Configuring the Individual Devices and Creating the Multi-Device On Top
As discussed in the first section, you shall configure each individual device as usual and then just create the "MULTI" device on top:
@snippet openvino/docs/snippets/MULTI4.cpp part4
@snippet snippets/MULTI4.cpp part4
Alternatively, you can combine all the individual device settings into single config and load that, allowing the multi-device plugin to parse and apply that to the right devices. See code example in the next section.
@ -84,7 +84,7 @@ See section of the [Using the multi-device with OpenVINO samples and benchmarkin
## Querying the Optimal Number of Inference Requests
Notice that until R2 you had to calculate number of requests in your application for any device, e.g. you had to know that Intel® Vision Accelerator Design with Intel® Movidius™ VPUs required at least 32 inference requests to perform well. Now you can use the new GetMetric API to query the optimal number of requests. Similarly, when using the multi-device you don't need to sum over included devices yourself, you can query metric directly:
@snippet openvino/docs/snippets/MULTI5.cpp part5
@snippet snippets/MULTI5.cpp part5
## Using the Multi-Device with OpenVINO Samples and Benchmarking the Performance
Notice that every OpenVINO sample that supports "-d" (which stays for "device") command-line option transparently accepts the multi-device.

View File

@ -844,11 +844,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = cnn_network_ngraph_impl.hpp \
ie_imemory_state_internal.hpp \
ie_memory_state_internal.hpp \
ie_memory_state_base.hpp \
generic_ie.hpp \
EXCLUDE_PATTERNS = generic_ie.hpp \
function_name.hpp \
macro_overload.hpp

View File

@ -92,7 +92,7 @@ Returns a metric value for a metric with the name `name`. A metric is a static
@snippet src/template_executable_network.cpp executable_network:get_metric
The IE_SET_METRIC helper macro sets metric value and checks that the actual metric type matches a type of the specified value.
The IE_SET_METRIC_RETURN helper macro sets metric value and checks that the actual metric type matches a type of the specified value.
### `GetConfig()`

View File

@ -1,11 +1,11 @@
# Representation of low-precision models
# Representation of low-precision models {#lp_representation}
The goal of this document is to describe how optimized models are represented in OpenVINO Intermediate Representation (IR) and provide guidance on interpretation rules for such models at runtime.
Currently, there are two groups of optimization methods that can influence on the IR after applying them to the full-precision model:
- **Sparsity**. It is represented by zeros inside the weights and this is up to the hardware plugin how to interpret these zeros (use weights as is or apply special compression algorithms and sparse arithmetic). No additional mask is provided with the model.
- **Quantization**. The rest of this document is dedicated to the representation of quantized models.
## Representation of quantized models
The OpenVINO Toolkit represents all the quantized models using the so-called FakeQuantize operation (see the description in [this document](../MO_DG/prepare_model/convert_model/Legacy_IR_Layers_Catalog_Spec.md)). This operation is very expressive and allows mapping values from arbitrary input and output ranges. The whole idea behind that is quite simple: we project (discretize) the input values to the low-precision data type using affine transformation (with clamp and rounding) and then reproject discrete values back to the original range and data type. It can be considered as an emulation of the quantization process which happens at runtime.
The OpenVINO Toolkit represents all the quantized models using the so-called FakeQuantize operation (see the description in [this document](@ref openvino_docs_ops_quantization_FakeQuantize_1)). This operation is very expressive and allows mapping values from arbitrary input and output ranges. The whole idea behind that is quite simple: we project (discretize) the input values to the low-precision data type using affine transformation (with clamp and rounding) and then reproject discrete values back to the original range and data type. It can be considered as an emulation of the quantization process which happens at runtime.
In order to be able to execute a particular DL operation in low-precision all its inputs should be quantized i.e. should have FakeQuantize between operation and data blobs. The figure below shows an example of quantized Convolution which contains two FakeQuantize nodes: one for weights and one for activations (bias is quantized using the same parameters).
![quantized_convolution]
<div align="center">Figure 1. Example of quantized Convolution operation.</div>

View File

@ -3,13 +3,13 @@
One of the feature of Inference Engine is the support of quantized networks with different precisions: INT8, INT4, etc.
However, it is up to the plugin to define what exact precisions are supported by the particular HW.
All quantized networks which can be expressed in IR have a unified representation by means of *FakeQuantize* operation.
For more details about low-precision model representation please refer to this [document](LowPrecisionModelRepresentation.md).
For more details about low-precision model representation please refer to this [document](@ref lp_representation).
### Interpreting FakeQuantize at runtime
During the model load each plugin can interpret quantization rules expressed in *FakeQuantize* operations:
- Independently based on the definition of *FakeQuantize* operation.
- Using a special library of low-precision transformations (LPT) which applies common rules for generic operations,
such as Convolution, Fully-Connected, Eltwise, etc., and translates "fake-quantized" models into the models with low-precision operations. For more information about low-precision flow please refer to the following [document](../IE_DG/Int8Inference.md).
such as Convolution, Fully-Connected, Eltwise, etc., and translates "fake-quantized" models into the models with low-precision operations. For more information about low-precision flow please refer to the following [document](@ref openvino_docs_IE_DG_Int8Inference).
Here we provide only a high-level overview of the interpretation rules of FakeQuantize.
At runtime each FakeQuantize can be split into two independent operations: **Quantize** and **Dequantize**.

View File

@ -17,8 +17,10 @@
</tab>
<!-- API References -->
<tab type="usergroup" title="API REFERENCE">
<!-- IE Developer Package -->
<tab type="modules" visible="yes" title="Inference Engine Plugin API Reference"/>
<!-- IE Plugin API -->
<tab type="user" url="group__ie__dev__api.html" visible="yes" title="Inference Engine Plugin API Reference"/>
<!-- IE Transformations API -->
<tab type="user" url="group__ie__transformation__api.html" visible="yes" title="Inference Engine Transformations API Reference"/>
</tab>
<tab type="usergroup" title="MAIN OPENVINO™ DOCS" url="../index.html"/>
</navindex>

View File

@ -114,6 +114,7 @@ Where `HEIGHT` and `WIDTH` are the input images height and width for which the m
| Unet | [Repo](https://github.com/kkweon/UNet-in-Tensorflow) |
| Keras-TCN | [Repo](https://github.com/philipperemy/keras-tcn) |
| PRNet | [Repo](https://github.com/YadiraF/PRNet) |
| YOLOv4 | [Repo](https://github.com/Ma-Dan/keras-yolo4) |
* YOLO topologies from DarkNet* can be converted using [instruction](tf_specific/Convert_YOLO_From_Tensorflow.md),
* FaceNet topologies can be converted using [instruction](tf_specific/Convert_FaceNet_From_Tensorflow.md).

View File

@ -2,16 +2,17 @@
EXCLUDE_SYMBOLS = INFERENCE_ENGINE_C_API_EXTERN \
INFERENCE_ENGINE_C_API \
INFERENCE_ENGINE_C_API_CALLBACK \
IE_NODISCARD
PREDEFINED = "__attribute__(x)=" \
"__VA_ARGS__=" \
"INFERENCE_ENGINE_C_API_EXTERN=" \
"INFERENCE_ENGINE_C_API_CALLBACK=" \
"INFERENCE_ENGINE_C_API=" \
"IE_NODISCARD=" \
"__cdecl=" \
"__declspec(x)=" \
"__GNUC__=" \
"_WIN32"
FILE_PATTERNS = *.h

View File

@ -903,8 +903,8 @@ EXCLUDE_PATTERNS = */temp/* \
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS = InferenceEngine::details \
InferenceEngine::gpu::details \
PRECISION_NAME \
TBLOB_TOP_RESULT \
CASE \
CASE2 \
_CONFIG_KEY \
@ -929,24 +929,26 @@ EXCLUDE_SYMBOLS = InferenceEngine::details \
INFERENCE_ENGINE_API_CPP \
INFERENCE_ENGINE_API_CLASS \
INFERENCE_ENGINE_DEPRECATED \
INFERENCE_ENGINE_NN_BUILDER_API_CLASS \
INFERENCE_ENGINE_NN_BUILDER_DEPRECATED \
IE_SUPPRESS_DEPRECATED_START \
IE_SUPPRESS_DEPRECATED_END \
IE_SUPPRESS_DEPRECATED_START_WIN \
IE_SUPPRESS_DEPRECATED_END_WIN \
IE_SUPPRESS_DEPRECATED_END_WIN \
INFERENCE_ENGINE_INTERNAL \
INFERENCE_ENGINE_INTERNAL_CNNLAYER_CLASS \
IE_DO_PRAGMA \
REG_VALIDATOR_FOR
parallel_* \
for_* \
splitter \
InferenceEngine::parallel_* \
NOMINMAX \
TBB_PREVIEW_NUMA_SUPPORT \
IE_THREAD_*
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
EXAMPLE_PATH = template_extension \
../inference-engine/samples
EXAMPLE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@"
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and

View File

@ -9,7 +9,12 @@ GENERATE_TAGFILE = "@DOCS_BINARY_DIR@/ie_plugin_api.tag"
EXTRACT_LOCAL_CLASSES = NO
INPUT = "@DOCS_BINARY_DIR@/docs/IE_PLUGIN_DG" \
"@IE_SOURCE_DIR@/src/plugin_api"
"@IE_SOURCE_DIR@/src/plugin_api" \
"@IE_SOURCE_DIR@/src/transformations/include" \
"@OpenVINO_MAIN_SOURCE_DIR@/openvino/itt/include/openvino"
RECURSIVE = YES
FILE_PATTERNS = *.c \
*.cpp \
@ -18,21 +23,20 @@ FILE_PATTERNS = *.c \
*.hpp \
*.md
EXCLUDE_PATTERNS = cnn_network_ngraph_impl.hpp \
ie_imemory_state_internal.hpp \
ie_memory_state_internal.hpp \
ie_memory_state_base.hpp \
convert_function_to_cnn_network.hpp \
generic_ie.hpp
EXCLUDE_PATTERNS = generic_ie.hpp
EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS = InferenceEngine::details
TAGFILES = @DOCS_BINARY_DIR@/ie_api.tag=.."
EXAMPLE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/src" \
"@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/include" \
"@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/src/CMakeLists.txt" \
"@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/tests/functional/"
CMakeLists.txt \
"@CMAKE_CURRENT_SOURCE_DIR@/examples"
"@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/tests/functional/CMakeLists.txt" \
"@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/tests/functional/transformations" \
"@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/tests/functional/shared_tests_instances/" \
"@CMAKE_CURRENT_SOURCE_DIR@/snippets"
"@IE_SOURCE_DIR@/tests/functional/plugin/shared/include" \
EXAMPLE_PATTERNS = *.cpp \
*.hpp
@ -41,12 +45,17 @@ ENUM_VALUES_PER_LINE = 1
EXPAND_ONLY_PREDEF = YES
PREDEFINED = INFERENCE_ENGINE_API \
INFERENCE_ENGINE_API_CPP \
INFERENCE_ENGINE_API_CLASS \
INFERENCE_ENGINE_DEPRECATED \
IE_SUPPRESS_DEPRECATED_START \
IE_SUPPRESS_DEPRECATED_END \
IE_SUPPRESS_DEPRECATED_START_WIN \
IE_SUPPRESS_DEPRECATED_END_WIN \
IE_THREAD=IE_THREAD_TBB
PREDEFINED = "INFERENCE_ENGINE_API=" \
"INFERENCE_ENGINE_API_CPP=" \
"INFERENCE_ENGINE_API_CLASS=" \
"INFERENCE_ENGINE_DEPRECATED=" \
"inference_engine_transformations_EXPORTS" \
"TRANSFORMATIONS_API=" \
"NGRAPH_HELPER_DLL_EXPORT=" \
"NGRAPH_HELPER_DLL_IMPORT=" \
"IE_SUPPRESS_DEPRECATED_START=" \
"IE_SUPPRESS_DEPRECATED_END=" \
"IE_SUPPRESS_DEPRECATED_START_WIN=" \
"IE_SUPPRESS_DEPRECATED_END_WIN=" \
"IE_THREAD=IE_THREAD_TBB" \
"NGRAPH_RTTI_DECLARATION="

View File

@ -16,8 +16,10 @@
</tab>
<!-- API References -->
<tab type="usergroup" title="API REFERENCE">
<!-- IE Developer Package -->
<tab type="modules" visible="yes" title="Inference Engine Plugin API Reference"/>
<!-- IE Plugin API Reference -->
<tab type="user" url="group__ie__dev__api.html" visible="yes" title="Inference Engine Plugin API Reference"/>
<!-- IE Transformations API Reference -->
<tab type="user" url="group__ie__transformation__api.html" visible="yes" title="Inference Engine Transformations API Reference"/>
</tab>
<tab type="usergroup" title="MAIN OPENVINO™ DOCS" url="../index.html"/>
</navindex>

View File

@ -6,7 +6,7 @@
<!-- GET STARTED category -->
<tab type="usergroup" title="GET STARTED" url="index.html">
<!-- Install Directly -->
<tab type="usergroup" title="Install Directly" url=""><!--automatically generated-->
<tab type="usergroup" title="Installation Guides" url=""><!--automatically generated-->
<tab type="usergroup" title="Linux" url="@ref openvino_docs_install_guides_installing_openvino_linux">
<tab type="user" title="Install Intel® Distribution of OpenVINO™ toolkit for Linux* OS" url="@ref openvino_docs_install_guides_installing_openvino_linux"/>
<tab type="user" title="[DEPRECATED] Install Intel® Distribution of OpenVINO™ toolkit for Linux with FPGA Support" url="@ref openvino_docs_install_guides_installing_openvino_linux_fpga"/>
@ -17,19 +17,21 @@
</tab>
<tab type="user" title="macOS" url="@ref openvino_docs_install_guides_installing_openvino_macos"/>
<tab type="user" title="Raspbian OS" url="@ref openvino_docs_install_guides_installing_openvino_raspbian"/>
<tab type="user" title="DL Workbench Installation Guide" url="./workbench_docs_Workbench_DG_Install_Workbench.html"/><!-- Link to the original Workbench topic -->
</tab>
<!-- Install From Images and Repositories -->
<tab type="usergroup" title="Install From Images and Repositories" url=""><!--automatically generated-->
<tab type="usergroup" title="Install From Images and Repositories" url="@ref openvino_docs_install_guides_installing_openvino_images">
<tab type="usergroup" title="Docker" url="@ref openvino_docs_install_guides_installing_openvino_docker_linux">
<tab type="user" title="Install Intel® Distribution of OpenVINO™ toolkit for Linux* from a Docker* Image" url="@ref openvino_docs_install_guides_installing_openvino_docker_linux"/>
<tab type="user" title="Install Intel® Distribution of OpenVINO™ toolkit for Windows* from a Docker* Image" url="@ref openvino_docs_install_guides_installing_openvino_docker_windows"/>
</tab>
<tab type="user" title="Docker with DL Workbench" url="./workbench_docs_Workbench_DG_Install_from_Docker_Hub.html"/><!-- Link to the original Workbench topic -->
<tab type="user" title="APT" url="@ref openvino_docs_install_guides_installing_openvino_apt"/>
<tab type="user" title="YUM" url="@ref openvino_docs_install_guides_installing_openvino_yum"/>
<tab type="user" title="Anaconda Cloud" url="@ref openvino_docs_install_guides_installing_openvino_conda"/>
<tab type="user" title="Yocto" url="@ref openvino_docs_install_guides_installing_openvino_yocto"/>
<tab type="user" title="PyPI" url="@ref openvino_docs_install_guides_installing_openvino_pip"/>
<tab type="user" title="Build from Source" url="https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md"/>
<tab type="user" title="Build from Source" url="https://github.com/openvinotoolkit/openvino/wiki/BuildingCode"/>
</tab>
<!-- Get Started Guides-->
<tab type="usergroup" title="Get Started Guides" url=""><!--automatically generated-->
@ -37,7 +39,9 @@
<tab type="user" title="Linux" url="@ref openvino_docs_get_started_get_started_linux"/>
<tab type="user" title="Windows" url="@ref openvino_docs_get_started_get_started_windows"/>
<tab type="user" title="macOS" url="@ref openvino_docs_get_started_get_started_macos"/>
<tab type="user" title="Get Started with OpenVINO via DL Workbench" url="@ref openvino_docs_get_started_get_started_dl_workbench"/>
<tab type="user" title="Legal Information" url="@ref openvino_docs_Legal_Information"/>
<tab type="user" title="Introduction to DL Workbench" url="./openvino_docs_get_started_get_started_dl_workbench.html"/><!-- Link to the original Workbench topic -->
</tab>
<!-- Configuration for Hardware -->
<tab type="usergroup" title="Configuration for Hardware" url=""><!--automatically generated-->
@ -120,14 +124,15 @@
<tab type="user" title="Hello Query Device C++ Sample" url="@ref openvino_inference_engine_samples_hello_query_device_README"/>
<tab type="user" title="Hello Query Device Python* Sample" url="@ref openvino_inference_engine_ie_bridges_python_sample_hello_query_device_README"/>
<tab type="user" title="nGraph Function C++ Sample" url="@ref openvino_inference_engine_samples_ngraph_function_creation_sample_README"/>
<tab type="user" title="nGraph Function Python Sample" url="@ref openvino_inference_engine_ie_bridges_python_samples_ngraph_function_creation_sample_README"/>
<tab type="user" title="Object Detection C++ Sample SSD" url="@ref openvino_inference_engine_samples_object_detection_sample_ssd_README"/>
<tab type="user" title="Object Detection Python* Sample SSD" url="@ref openvino_inference_engine_ie_bridges_python_sample_object_detection_sample_ssd_README"/>
<tab type="user" title="Object Detection C Sample SSD" url="@ref openvino_inference_engine_ie_bridges_c_samples_object_detection_sample_ssd_README"/>
<tab type="user" title="Automatic Speech Recognition C++ Sample" url="@ref openvino_inference_engine_samples_speech_sample_README"/>
<tab type="user" title="Neural Style Transfer C++ Sample" url="@ref openvino_inference_engine_samples_style_transfer_sample_README"/>
<tab type="user" title="Neural Style Transfer Python* Sample" url="@ref openvino_inference_engine_ie_bridges_python_sample_style_transfer_sample_README"/>
<tab type="user" title="Benchmark C++ App" url="@ref openvino_inference_engine_samples_benchmark_app_README"/>
<tab type="user" title="Benchmark Python* App" url="@ref openvino_inference_engine_tools_benchmark_tool_README"/>
<tab type="user" title="Benchmark C++ Tool" url="@ref openvino_inference_engine_samples_benchmark_app_README"/>
<tab type="user" title="Benchmark Python* Tool" url="@ref openvino_inference_engine_tools_benchmark_tool_README"/>
</tab>
<!-- DL Streamer Examples -->

View File

@ -195,7 +195,7 @@ You will perform the following steps:
Each demo and code sample is a separate application, but they use the same behavior and components. The code samples and demo applications are:
* [Code Samples](../IE_DG/Samples_Overview.html) - Small console applications that show how to utilize specific OpenVINO capabilities within an application and execute specific tasks such as loading a model, running inference, querying specific device capabilities, and more.
* [Code Samples](../IE_DG/Samples_Overview.md) - Small console applications that show how to utilize specific OpenVINO capabilities within an application and execute specific tasks such as loading a model, running inference, querying specific device capabilities, and more.
* [Demo Applications](@ref omz_demos_README) - Console applications that provide robust application templates to support developers in implementing specific deep learning scenarios. They may also involve more complex processing pipelines that gather analysis from several models that run inference simultaneously. For example concurrently detecting a person in a video stream and detecting attributes such as age, gender and/or emotions.
@ -370,7 +370,7 @@ As an alternative, the Intel® Distribution of OpenVINO™ toolkit includes two
### <a name="run-image-classification"></a>Step 4: Run the Image Classification Code Sample
> **NOTE**: The Image Classification code sample is automatically compiled when you ran the Image Classification demo script. If you want to compile it manually, see the [Inference Engine Code Samples Overview](../IE_DG/Samples_Overview.html#build_samples_linux) section.
> **NOTE**: The Image Classification code sample is automatically compiled when you ran the Image Classification demo script. If you want to compile it manually, see the *Build the Sample Applications on Linux* section in the [Inference Engine Code Samples Overview](../IE_DG/Samples_Overview.md).
To run the **Image Classification** code sample with an input image on the IR:

View File

@ -99,4 +99,4 @@ Intel® Distribution of OpenVINO™ toolkit includes the following components:
- [OpenCV](https://docs.opencv.org/master/) - OpenCV* community version compiled for Intel® hardware
- [Intel® Media SDK](https://software.intel.com/en-us/media-sdk) (in Intel® Distribution of OpenVINO™ toolkit for Linux only)
OpenVINO™ Toolkit opensource version is available on [GitHub](https://github.com/openvinotoolkit/openvino). For building the Inference Engine from the source code, see the <a href="https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md">build instructions</a>.
OpenVINO™ Toolkit opensource version is available on [GitHub](https://github.com/openvinotoolkit/openvino). For building the Inference Engine from the source code, see the <a href="https://github.com/openvinotoolkit/openvino/wiki/BuildingCode">build instructions</a>.

View File

@ -0,0 +1,14 @@
# Install From Images and Repositories {#openvino_docs_install_guides_installing_openvino_images}
You may install Intel® Distribution of OpenVINO™ toolkit from images and repositories using the **Install OpenVINO™** button above or directly from the [Get the Intel® Distribution of OpenVINO™ Toolkit](https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit/download.html) page. Use the documentation below if you need additional support:
* [Docker](installing-openvino-docker-linux.md)
* [Docker with DL Workbench](@ref workbench_docs_Workbench_DG_Install_from_Docker_Hub)
* [APT](installing-openvino-apt.md)
* [YUM](installing-openvino-yum.md)
* [Anaconda Cloud](installing-openvino-conda.md)
* [Yocto](installing-openvino-yocto.md)
* [PyPI](installing-openvino-pip.md)
The open source version is available in the [OpenVINO™ toolkit GitHub repository](https://github.com/openvinotoolkit/openvino) and you can build it for supported platforms using the <a href="https://github.com/openvinotoolkit/openvino/wiki/BuildingCode">Inference Engine Build Instructions</a>.

View File

@ -9,7 +9,7 @@
## Introduction
The Intel® Distribution of OpenVINO™ toolkit quickly deploys applications and solutions that emulate human vision. Based on Convolutional Neural Networks (CNN), the toolkit extends computer vision (CV) workloads across Intel® hardware, maximizing performance. The Intel® Distribution of OpenVINO™ toolkit includes the Intel® Deep Learning Deployment Toolkit (Intel® DLDT).
OpenVINO™ toolkit is a comprehensive toolkit for quickly developing applications and solutions that solve a variety of tasks including emulation of human vision, automatic speech recognition, natural language processing, recommendation systems, and many others. Based on latest generations of artificial neural networks, including Convolutional Neural Networks (CNNs), recurrent and attention-based networks, the toolkit extends computer vision and non-vision workloads across Intel® hardware, maximizing performance. It accelerates applications with high-performance, AI and deep learning inference deployed from edge to cloud.
The Intel® Distribution of OpenVINO™ toolkit for Linux\*:
- Enables CNN-based deep learning inference on the edge
@ -28,7 +28,8 @@ The Intel® Distribution of OpenVINO™ toolkit for Linux\*:
| [Inference Engine Code Samples](../IE_DG/Samples_Overview.md) | A set of simple console applications demonstrating how to utilize specific OpenVINO capabilities in an application and how to perform specific tasks, such as loading a model, running inference, querying specific device capabilities, and more. |
| [Demo Applications](@ref omz_demos_README) | A set of simple console applications that provide robust application templates to help you implement specific deep learning scenarios. |
| Additional Tools | A set of tools to work with your models including [Accuracy Checker utility](@ref omz_tools_accuracy_checker_README), [Post-Training Optimization Tool Guide](@ref pot_README), [Model Downloader](@ref omz_tools_downloader_README) and other |
| [Documentation for Pre-Trained Models ](@ref omz_models_intel_index) | Documentation for the pre-trained models available in the [Open Model Zoo repo](https://github.com/opencv/open_model_zoo) |
| [Documentation for Pre-Trained Models ](@ref omz_models_intel_index) | Documentation for the pre-trained models available in the [Open Model Zoo repo](https://github.com/opencv/open_model_zoo). |
| Deep Learning Streamer (DL Streamer) | Streaming analytics framework, based on GStreamer, for constructing graphs of media analytics components. For the DL Streamer documentation, see [DL Streamer Samples](@ref gst_samples_README), [API Reference](https://openvinotoolkit.github.io/dlstreamer_gst/), [Elements](https://github.com/opencv/gst-video-analytics/wiki/Elements), [Tutorial](https://github.com/opencv/gst-video-analytics/wiki/DL%20Streamer%20Tutorial). |
## System Requirements
@ -84,28 +85,25 @@ If you downloaded the package file to the current user's `Downloads` directory:
```sh
cd ~/Downloads/
```
By default, the file is saved as `l_openvino_toolkit_p_<version>.tgz`.
By default, the file is saved as `l_openvino_toolkit_p_<version>.tgz`.
3. Unpack the .tgz file:
```sh
tar -xvzf l_openvino_toolkit_p_<version>.tgz
```
The files are unpacked to the `l_openvino_toolkit_p_<version>` directory.
The files are unpacked to the `l_openvino_toolkit_p_<version>` directory.
4. Go to the `l_openvino_toolkit_p_<version>` directory:
```sh
cd l_openvino_toolkit_p_<version>
```
If you have a previous version of the Intel Distribution of OpenVINO
If you have a previous version of the Intel Distribution of OpenVINO
toolkit installed, rename or delete these two directories:
- `~/inference_engine_samples_build`
- `~/openvino_models`
**Installation Notes:**
- Choose an installation option and run the related script as root.
- You can use either a GUI installation wizard or command-line instructions (CLI).
- Screenshots are provided for the GUI, but not for CLI. The following information also applies to CLI and will be helpful to your installation where you will be presented with the same choices and tasks.
**Installation Notes:**
- Choose an installation option and run the related script as root.
- You can use either a GUI installation wizard or command-line instructions (CLI).
- Screenshots are provided for the GUI, but not for CLI. The following information also applies to CLI and will be helpful to your installation where you will be presented with the same choices and tasks.
5. Choose your installation option:
- **Option 1:** GUI Installation Wizard:
@ -164,7 +162,7 @@ cd /opt/intel/openvino_2021/install_dependencies
```sh
sudo -E ./install_openvino_dependencies.sh
```
The dependencies are installed. Continue to the next section to set your environment variables.
The dependencies are installed. Continue to the next section to set your environment variables.
## <a name="set-the-environment-variables"></a>Set the Environment Variables
@ -287,20 +285,18 @@ cd /opt/intel/openvino_2021/deployment_tools/demo
```sh
./demo_squeezenet_download_convert_run.sh
```
This verification script downloads a SqueezeNet model, uses the Model Optimizer to convert the model to the .bin and .xml Intermediate Representation (IR) files. The Inference Engine requires this model conversion so it can use the IR as input and achieve optimum performance on Intel hardware.<br>
This verification script builds the [Image Classification Sample Async](../../inference-engine/samples/classification_sample_async/README.md) application and run it with the `car.png` image located in the demo directory. When the verification script completes, you will have the label and confidence for the top-10 categories:
![](../img/image_classification_script_output_lnx.png)
This verification script downloads a SqueezeNet model, uses the Model Optimizer to convert the model to the .bin and .xml Intermediate Representation (IR) files. The Inference Engine requires this model conversion so it can use the IR as input and achieve optimum performance on Intel hardware.<br>
This verification script builds the [Image Classification Sample Async](../../inference-engine/samples/classification_sample_async/README.md) application and run it with the `car.png` image located in the demo directory. When the verification script completes, you will have the label and confidence for the top-10 categories:
![](../img/image_classification_script_output_lnx.png)
3. Run the **Inference Pipeline verification script**:
```sh
./demo_security_barrier_camera.sh
```
This script downloads three pre-trained model IRs, builds the [Security Barrier Camera Demo](@ref omz_demos_security_barrier_camera_demo_README) application, and runs it with the downloaded models and the `car_1.bmp` image from the `demo` directory to show an inference pipeline. The verification script uses vehicle recognition in which vehicle attributes build on each other to narrow in on a specific attribute.
First, an object is identified as a vehicle. This identification is used as input to the next model, which identifies specific vehicle attributes, including the license plate. Finally, the attributes identified as the license plate are used as input to the third model, which recognizes specific characters in the license plate.
When the verification script completes, you will see an image that displays the resulting frame with detections rendered as bounding boxes, and text:
![](../img/inference_pipeline_script_lnx.png)
This script downloads three pre-trained model IRs, builds the [Security Barrier Camera Demo](@ref omz_demos_security_barrier_camera_demo_README) application, and runs it with the downloaded models and the `car_1.bmp` image from the `demo` directory to show an inference pipeline. The verification script uses vehicle recognition in which vehicle attributes build on each other to narrow in on a specific attribute.<br>
First, an object is identified as a vehicle. This identification is used as input to the next model, which identifies specific vehicle attributes, including the license plate. Finally, the attributes identified as the license plate are used as input to the third model, which recognizes specific characters in the license plate.<br>
When the verification script completes, you will see an image that displays the resulting frame with detections rendered as bounding boxes, and text:
![](../img/inference_pipeline_script_lnx.png)
4. Close the image viewer window to complete the verification script.
@ -331,20 +327,15 @@ sudo -E su
```sh
./install_NEO_OCL_driver.sh
```
The drivers are not included in the package and the script downloads them. Make sure you have the
internet connection for this step.
The script compares the driver version on the system to the current version.
If the driver version on the system is higher or equal to the current version, the script does
not install a new driver.
If the version of the driver is lower than the current version, the script uninstalls the lower
and installs the current version with your permission:
![](../img/NEO_check_agreement.png)
Higher hardware versions require a higher driver version, namely 20.35 instead of 19.41.
If the script fails to uninstall the driver, uninstall it manually.
During the script execution, you may see the following command line output:
- Add OpenCL user to video group
Ignore this suggestion and continue.
The drivers are not included in the package and the script downloads them. Make sure you have the internet connection for this step.<br>
The script compares the driver version on the system to the current version. If the driver version on the system is higher or equal to the current version, the script does
not install a new driver. If the version of the driver is lower than the current version, the script uninstalls the lower and installs the current version with your permission:
![](../img/NEO_check_agreement.png)
Higher hardware versions require a higher driver version, namely 20.35 instead of 19.41. If the script fails to uninstall the driver, uninstall it manually. During the script execution, you may see the following command line output:
```sh
Add OpenCL user to video group
```
Ignore this suggestion and continue.
4. **Optional** Install header files to allow compiling a new code. You can find the header files at [Khronos OpenCL™ API Headers](https://github.com/KhronosGroup/OpenCL-Headers.git).
## <a name="additional-NCS-steps"></a>Steps for Intel® Neural Compute Stick 2
@ -355,8 +346,7 @@ These steps are only required if you want to perform inference on Intel® Movidi
```sh
sudo usermod -a -G users "$(whoami)"
```
Log out and log in for it to take effect.
Log out and log in for it to take effect.
2. To perform inference on Intel® Neural Compute Stick 2, install the USB rules as follows:
```sh
sudo cp /opt/intel/openvino_2021/inference_engine/external/97-myriad-usbboot.rules /etc/udev/rules.d/

View File

@ -18,11 +18,11 @@ The structure should hold:
1. A pointer to an inference request.
2. An ID to keep track of the request.
@snippet openvino/docs/snippets/movidius-programming-guide.cpp part0
@snippet snippets/movidius-programming-guide.cpp part0
### Declare a Vector of Requests
@snippet openvino/docs/snippets/movidius-programming-guide.cpp part1
@snippet snippets/movidius-programming-guide.cpp part1
Declare and initialize 2 mutex variables:
1. For each request
@ -34,9 +34,9 @@ Conditional variable indicates when at most 8 requests are done at a time.
For inference requests, use the asynchronous IE API calls:
@snippet openvino/docs/snippets/movidius-programming-guide.cpp part2
@snippet snippets/movidius-programming-guide.cpp part2
@snippet openvino/docs/snippets/movidius-programming-guide.cpp part3
@snippet snippets/movidius-programming-guide.cpp part3
### Create a Lambda Function
@ -45,7 +45,7 @@ Lambda Function enables the parsing and display of results.
Inside the Lambda body use the completion callback function:
@snippet openvino/docs/snippets/movidius-programming-guide.cpp part4
@snippet snippets/movidius-programming-guide.cpp part4
## Additional Resources

View File

@ -14,10 +14,11 @@ Transformation library is independent from Inference Engine target library named
and is located in the `inference-engine/src/transformations` directory.
Transformations root directory contains two folders:
* `ngraph_ops` - Contains legacy opset operations needed for nGraph to CNNNetwork conversion.
> **NOTE**: This operation is prohibited inside new plugins until they are not moved to a separate directory with allowed operations.
* `ngraph_ops` - Contains internal opset operations that are common for plugins.
* `transformations` - Includes all transformations, utils, runtime info attributes, and pass managers.
> **NOTE**: Do not use transformation that belongs to `ngraph::pass::ConvertOpSet1ToLegacy` transformations until they are not moved to a separate directory with allowed transformations.
All internal operations and transformations located inside the [Transformation Library](group__ie__transformation__api.html) can be used inside plugins.
All legacy operations and transformations were moved to a legacy library and are not recommended to be used.
### Transformation Flow Layers
Transformation flow in the transformation library has several layers:
@ -32,15 +33,15 @@ But if some transformation parts can potentially be reused in other transformati
To decide where to store your transformation code, please follow these rules:
1. If it is a plugin-specific transformation and cannot be reused by other plugins, keep source code inside plugin.
2. If this transformation relates to the OpSetXToOpSetY conversion or it is common optimization, keep sources inside the transformation library.
2. If this transformation relates to opset operation conversion or optimization, keep sources inside the transformation library.
After you decide where to store your transformation code, you can start developing your own nGraph transformation.
## ngraph::Function and graph representation <a name="ngraph_function"></a>
An nGraph function is a simple thing: it stores shared pointers to `ngraph::op::Result` and `ngraph::op::Parameter` operations that are inputs and outputs of the graph.
All other operations hold each other via shared pointers: child operation holds its parent (hard link). If the operation has no consumers and it is not a Result operation
(shared pointer counter is zero), it is destructed and is not accessible anymore. Each operation in `ngraph::Function` has a `std::shared_ptr<ngraph::Node>` type.
nGraph function is a very simple thing: it stores shared pointers to `ngraph::op::Parameter`, `ngraph::op::Result` and `ngraph::op::Sink` operations that are inputs, outputs and sinks of the graph.
Sinks of the graph have no consumers and not included into results vector. All other operations hold each other via shared pointers: child operation holds its parent (hard link). If operation has no consumers and it's not Result or Sink operation
(shared pointer counter is zero) then it will be destructed and won't be accessible anymore. Each operation in `ngraph::Function` has a `std::shared_ptr<ngraph::Node>` type.
For examples of how to build an nGraph function, see the [Build nGraph Function](./build_function.md) page.
@ -50,7 +51,7 @@ nGraph has three main transformation types:
* `ngraph::pass::FunctionPass` - straightforward way to work with `ngraph::Function` directly
* `ngraph::pass::MatcherPass` - pattern-based transformation approach
* `ngraph::pass::GraphRewrite` - container for matcher passes
* `ngraph::pass::GraphRewrite` - container for matcher passes needed for efficient execution
![transformations_structure]
@ -87,14 +88,15 @@ To use `ngraph::pass::MatcherPass`, you need to complete these steps:
So let's go through each of these steps.
### Create a pattern
Pattern is a single root `ngraph::Function`. But the only difference is that you do not need to create a function object, you just need to create and connect nGraph or special pattern operations. Then you need to take the last created operation and put it as a root of the pattern. This root node will be used as a root node in pattern matching.
Pattern is a single root `ngraph::Function`. But the only difference is that you do not need to create a function object, you just need to create and connect opset or special pattern operations.
Then you need to take the last created operation and put it as a root of the pattern. This root node will be used as a root node in pattern matching.
> **NOTE**: Any nodes in a pattern that have no consumers and are not registered as root will not be used in pattern matching.
@snippet example_ngraph_utils.cpp pattern:simple_example
The `Parameter` operation in the example above has type and shape specified. These attributes are needed only to create Parameter operation class and will not be used in pattern matching.
For instructions on how to match a pattern where `ShapeOf` takes any operation as an input, follow the [pattern matching](#pattern_matching) section.
For more pattern examples, refer to the [pattern matching](#pattern_matching) section.
### Implement callback
Callback is an action applied to every pattern entrance. In general, callback is the lambda function that takes Matcher object with detected subgraph.
@ -153,6 +155,8 @@ And then creates map from registered MatcherPasses. That helps to avoid addition
![graph_rewrite_efficient_search]
> **NOTE**: GraphRewrite execution algorithm cannot be set manually and depends only on root nodes registered inside MatcherPasses.
## Pattern Matching <a name="pattern_matching"></a>
Sometimes patterns cannot be expressed via regular nGraph operations or it is too complicated.
@ -255,7 +259,7 @@ When developing a transformation, you need to follow these transformation rules:
###1. Operation Set (OpSet)
Use the latest version of OpSet in your transformation. An exception is ConvertOpSetXToOpSetY transformations, where you must use operations from OpSetX and OpSetY.
Use the latest version of OpSet in your transformation. An exception is op_conversion transformations, where different opsets can be used.
@snippet example_ngraph_utils.cpp ngraph:include
@ -399,33 +403,22 @@ NGRAPH_ENABLE_VISUALIZE_TRACING=1 - enables visualization after each transforma
## Disabling/Enabling specific transformations for plugin X <a name="disabling_transformation"></a>
This topic is mostly related to conversion to legacy opset and plugins that are based on CNNNetwork. But this mechanism still can be applied for other cases.
Let's suppose that plugin X enabled the `opset3::StridedSlice` operation support and you want to disable the `ngraph::pass::ConvertStridedSliceToCrop` transformation for plugin X.
To do this, you need to create a callback on plugin side and pass it to transformation. And also you need to update particular transformation to use this callback.
In transformation library, we provide plugins transformations like CommonOptimizations, which contains predefined sequence of transformations.
We also provide a tool that helps to disable or partially disable particular transformations in a transformation pipeline.
For example, if a plugin uses the CommonOptimization transformation and needs to disable the ConvertGELU transformation, then inside the plugin we have to take the PassConfig instance
from pass::Manger and call disable method.
```cpp
// Update callback to be able to use m_transformation_callback if this transformation based on GraphRewrite.
ngraph::graph_rewrite_callback callback = [this](pattern::Matcher &m) {
...
}
@snippet example_ngraph_utils.cpp ngraph:disable_gelu
// Use transformation_callback not to execute transformation if callback returns true for given node
if (m_transformation_callback(node)) {
return false;
}
In some cases, we need to disable transformation for some condition:
// Implement transformation callback and pass it directly to transformation or pass::Manager
const auto transformations_callback = [](const std::shared_ptr<const ::ngraph::Node> &node) -> bool {
return std::dynamic_pointer_cast<const ::ngraph::opset3::StridedSlice>(node) != nullptr;
};
@snippet example_ngraph_utils.cpp ngraph:disable_callback
// Register transformation and pass callback to pass::Manager
ngraph::pass::Manager manager;
manager.register_pass<ngraph::pass::ConvertStridedSliceToCrop>();
// pass::Manager will set callback to all reistered transformations automatically
manager.set_callback(transformations_callback);
manager.run_passes(f);
```
In some cases, pass::Manager pipelines inside transformations may have transformations disabled by default but enabled inside plugins.
@snippet example_ngraph_utils.cpp ngraph:disabled_by_default
PassConfig instance taken from pass::Manager is shared across all registered transformations including nested transformations. So it does not matter where we work with this object (before passes registration or after).
## Transformations testing <a name="transformations_testing"></a>

View File

@ -4,8 +4,8 @@ The nGraph represents neural networks in uniform format. User can create differe
## nGraph Function and Graph Representation <a name="ngraph_function"></a>
nGraph function is a very simple thing: it stores shared pointers to `ngraph::op::Result` and `ngraph::op::Parameter` operations that are inputs and outputs of the graph.
All other operations hold each other via shared pointers: child operation holds its parent (hard link). If operation has no consumers and it's not Result operation
nGraph function is a very simple thing: it stores shared pointers to `ngraph::op::Parameter`, `ngraph::op::Result` and `ngraph::op::Sink` operations that are inputs, outputs and sinks of the graph.
Sinks of the graph have no consumers and not included into results vector. All other operations hold each other via shared pointers: child operation holds its parent (hard link). If operation has no consumers and it's not Result or Sink operation
(shared pointer counter is zero) then it will be destructed and won't be accessible anymore. Each operation in `ngraph::Function` has a `std::shared_ptr<ngraph::Node>` type.
For details on how to build an nGraph Function, see the [Build nGraph Function](./build_function.md) page.

View File

@ -30,7 +30,7 @@
**Outputs**:
* **1**: Multidimensional output tensor with shape and type matching the input tensor. Required.
* **1**: Multidimensional output tensor with shape and type matching the input tensor.
**Detailed description**:

View File

@ -33,4 +33,4 @@ elu(x) = \left\{\begin{array}{ll}
**Outputs**:
* **1**: Result of Elu function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor. Required.
* **1**: Result of Elu function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor.

View File

@ -14,4 +14,4 @@
**Outputs**:
* **1**: Result of Exp function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor. Required.
* **1**: Result of Exp function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor.

View File

@ -28,6 +28,10 @@ Similarly, the following Gelu approximation (typical for the TensorFlow*) is rec
* **1**: Multidimensional input tensor. Required.
**Outputs**:
* **1**: Floating point tensor with shape and type matching the input tensor.
**Example**
```xml
@ -46,4 +50,4 @@ Similarly, the following Gelu approximation (typical for the TensorFlow*) is rec
</output>
</layer>
```
```

View File

@ -16,7 +16,7 @@
**Outputs**:
* **1**: Floating point tensor with shape and type matching the input tensor. Required.
* **1**: Floating point tensor with shape and type matching the input tensor.
**Types**
@ -47,4 +47,4 @@
</port>
</output>
</layer>
```
```

View File

@ -24,7 +24,7 @@
**Outputs**:
* **1**: Result of Sigmoid function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor. Required.
* **1**: Result of Sigmoid function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor.
**Example**
@ -44,4 +44,4 @@
</output>
</layer>
```
```

View File

@ -16,7 +16,7 @@
**Outputs**
* **1**: The result of element-wise sinh operation. A tensor of type T.
* **1**: The result of element-wise sinh operation. A tensor of type *T*.
**Types**
@ -47,4 +47,4 @@ a_{i} = sinh(a_{i})
</port>
</output>
</layer>
```
```

View File

@ -14,7 +14,7 @@
**Outputs**:
* **1**: Result of Tanh function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor. Required.
* **1**: Result of Tanh function applied to the input tensor *x*. Floating point tensor with shape and type matching the input tensor.
**Detailed description**
@ -22,4 +22,4 @@ For each element from the input tensor calculates corresponding
element in the output tensor with the following formula:
\f[
tanh ( x ) = \frac{2}{1+e^{-2x}} - 1 = 2sigmoid(2x) - 1
\f]
\f]

View File

@ -35,4 +35,5 @@ The operation has the same attributes as a regular *Convolution* layer and sever
**Outputs**:
* **1**: output tensor containing float values. Required.
* **1**: output tensor containing float values.

View File

@ -153,7 +153,7 @@ the second optional tensor of shape `[batch_size * post_nms_topn]` with probabil
* **1**: tensor of type *T* and shape `[batch_size * post_nms_topn, 5]`.
* **2**: tensor of type *T* and shape `[batch_size * post_nms_topn]` with probabilities. *Optional*.
* **2**: tensor of type *T* and shape `[batch_size * post_nms_topn]` with probabilities.
**Types**
@ -191,4 +191,4 @@ the second optional tensor of shape `[batch_size * post_nms_topn]` with probabil
</port>
</output>
</layer>
```
```

View File

@ -50,7 +50,7 @@
**Outputs**:
* **1**: 4D output tensor of shape `[NUM_ROIS, C, pooled_h, pooled_w]` with feature maps. Required.
* **1**: 4D output tensor of shape `[NUM_ROIS, C, pooled_h, pooled_w]` with feature maps.
**Example**
@ -60,4 +60,4 @@
<input> ... </input>
<output> ... </output>
</layer>
```
```

View File

@ -26,7 +26,7 @@
**Outputs**:
* **1**: 4D output tensor of the same type as input tensor and shape `[N, C*stride*stride, H/stride, W/stride]`. Required.
* **1**: 4D output tensor of the same type as input tensor and shape `[N, C*stride*stride, H/stride, W/stride]`.
**Example**

View File

@ -63,10 +63,11 @@ Loop operation description in the IR has regular sections: `input` and `output`.
Loop operation description in the IR also has several special sections: `body`, `port_map` and `back_edges` similar to the ones from the TensorIterator operation but having some important features described below.
1. The body operation getting an input from the main graph should have an entry in the `port_map` section of the Loop operation. These edges connect input ports of the Loop with the body `Parameter`s.
2. The body operation producing tensor to be used in the subsequent iterations (like in RNN models) should have a back edge described in the `back_edges` section of the operation. The back edge connects the respective body `Parameter` and `Result` operations. For such a case the Loop operation node provides input for the first iteration, while corresponding Loop operation output produces the tensor computed during the last iteration.
3. Output tensors produced by a particular body operation across all iterations can be concatenated and returned as a Loop operation output (this is a "scan output" according to the ONNX* Loop operation [specification](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Loop-13)). The corresponding `output` entry in the `port_map` should have `axis` attribute specifying the axis to concatenate. Therefore, outputs from operations corresponding to `output` entries in the `port_map` without `axis` attribute are returned "as is" (without concatenation).
4. There is one body `Parameter` operation not connected through the `port_map`. This is a "current iteration" input. The Loop operation is responsible for providing the appropriate value for each iteration.
5. Connection of nodes inside the Loop body with the main graph should be done through `Parameter` and `Result` body operations. No other ways to connect graphs are allowed.
2. Input tensors to the Loop can be sliced along a specified axis, the Loop can iterates over all sliced parts. The corresponding `input` entry in the `port_map` should have `axis` attribute specifying the axis to slice. Therefore, inputs to the Loop operation corresponding to `input` entries in the `port_map` without `axis` attribute are used "as is" (without slicing).
3. The body operation producing tensor to be used in the subsequent iterations (like in RNN models) should have a back edge described in the `back_edges` section of the operation. The back edge connects the respective body `Parameter` and `Result` operations. For such a case the Loop operation node provides input for the first iteration, while corresponding Loop operation output produces the tensor computed during the last iteration.
4. Output tensors produced by a particular body operation across all iterations can be concatenated and returned as a Loop operation output (this is a "scan output" according to the ONNX* Loop operation [specification](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Loop-13)). The corresponding `output` entry in the `port_map` should have `axis` attribute specifying the axis to concatenate. Therefore, outputs from operations corresponding to `output` entries in the `port_map` without `axis` attribute are returned "as is" (without concatenation).
5. There is one body `Parameter` operation not connected through the `port_map`. This is a "current iteration" input. The Loop operation is responsible for providing the appropriate value for each iteration.
6. Connection of nodes inside the Loop body with the main graph should be done through `Parameter` and `Result` body operations. No other ways to connect graphs are allowed.
**Loop attributes**:
@ -101,7 +102,8 @@ Loop operation description in the IR also has several special sections: `body`,
* *axis*
* **Description**: *axis* is an axis to concatenate the body `Result` output across all iterations. Can be specified for `output` entry only.
* **Description**: if *axis* is specified for `output` entry, then it is an axis to concatenate the body `Result` output across all iterations.
If *axis* is specified for `input` entry, then it is an axis to iterate through, it triggers the slicing of the input tensor.
* **Range of values**: an integer. Negative value means counting dimension from the end.
* **Type**: `int`
* **Default value**: None

View File

@ -14,6 +14,10 @@
* **2**: 0D or 1D tensor of type *T_SHAPE* with dimensions indices to squeeze. Values could be negative. *Optional*.
**Outputs**:
* **1**: Tensor with squeezed values of type *T*.
**Types**
* *T*: supported type.
@ -65,4 +69,4 @@
</port>
</output>
</layer>
```
```

View File

@ -14,6 +14,10 @@
* **2**: OD or 1D tensor of type *T_SHAPE* with dimensions indices to be set to 1. Values could be negative. *Required*.
**Outputs**:
* **1**: Tensor with unsqueezed values of type *T*.
**Types**
* *T*: supported type.
@ -65,4 +69,4 @@
</port>
</output>
</layer>
```
```

View File

@ -10,12 +10,12 @@
1. Take the box with highest score. If the score is less than `score_threshold` then stop. Otherwise add the box to the
output and continue to the next step.
2. For each input box, calculate the IOU (intersection over union) with the box added during the previous step. If the
value is greater than the `iou_threshold` threshold then remove the input box from further consideration.
2. For each input box, calculate the IOU (intersection over union) with the box added during the previous step. If the
value is greater than the `iou_threshold` threshold then remove the input box from further consideration.
3. Return to step 1.
This algorithm is applied independently to each class of each batch element. The total number of output boxes for each
class must not exceed `max_output_boxes_per_class`.
class must not exceed `max_output_boxes_per_class`.
**Attributes**:
@ -54,7 +54,7 @@ class must not exceed `max_output_boxes_per_class`.
**Outputs**:
* **1**: `selected_indices` - integer tensor of shape `[min(num_boxes, max_output_boxes_per_class * num_classes), 3]` containing information about selected boxes as triplets `[batch_index, class_index, box_index]`.
The output tensor is filled with 0s for output tensor elements if the total number of selected boxes is less than the output tensor size.
The output tensor is filled with -1s for output tensor elements if the total number of selected boxes is less than the output tensor size.
**Example**

View File

@ -10,12 +10,12 @@
1. Take the box with highest score. If the score is less than `score_threshold` then stop. Otherwise add the box to the
output and continue to the next step.
2. For each input box, calculate the IOU (intersection over union) with the box added during the previous step. If the
value is greater than the `iou_threshold` threshold then remove the input box from further consideration.
2. For each input box, calculate the IOU (intersection over union) with the box added during the previous step. If the
value is greater than the `iou_threshold` threshold then remove the input box from further consideration.
3. Return to step 1.
This algorithm is applied independently to each class of each batch element. The total number of output boxes for each
class must not exceed `max_output_boxes_per_class`.
class must not exceed `max_output_boxes_per_class`.
**Attributes**:
@ -38,7 +38,7 @@ class must not exceed `max_output_boxes_per_class`.
* **Type**: boolean
* **Default value**: True
* **Required**: *no*
* *output_type*
* **Description**: the output tensor type
@ -62,7 +62,7 @@ class must not exceed `max_output_boxes_per_class`.
**Outputs**:
* **1**: `selected_indices` - tensor of type *T_IND* and shape `[min(num_boxes, max_output_boxes_per_class * num_classes), 3]` containing information about selected boxes as triplets `[batch_index, class_index, box_index]`.
The output tensor is filled with 0s for output tensor elements if the total number of selected boxes is less than the output tensor size.
The output tensor is filled with -1s for output tensor elements if the total number of selected boxes is less than the output tensor size.
**Types**

View File

@ -10,12 +10,12 @@
1. Take the box with highest score. If the score is less than `score_threshold` then stop. Otherwise add the box to the
output and continue to the next step.
2. For each input box, calculate the IOU (intersection over union) with the box added during the previous step. If the
value is greater than the `iou_threshold` threshold then remove the input box from further consideration.
2. For each input box, calculate the IOU (intersection over union) with the box added during the previous step. If the
value is greater than the `iou_threshold` threshold then remove the input box from further consideration.
3. Return to step 1.
This algorithm is applied independently to each class of each batch element. The total number of output boxes for each
class must not exceed `max_output_boxes_per_class`.
class must not exceed `max_output_boxes_per_class`.
**Attributes**:
@ -38,7 +38,7 @@ class must not exceed `max_output_boxes_per_class`.
* **Type**: boolean
* **Default value**: True
* **Required**: *no*
* *output_type*
* **Description**: the output tensor type
@ -62,7 +62,7 @@ class must not exceed `max_output_boxes_per_class`.
**Outputs**:
* **1**: `selected_indices` - tensor of type *T_IND* and shape `[min(num_boxes, max_output_boxes_per_class) * num_batches * num_classes, 3]` containing information about selected boxes as triplets `[batch_index, class_index, box_index]`.
The output tensor is filled with 0s for output tensor elements if the total number of selected boxes is less than the output tensor size.
The output tensor is filled with -1s for output tensor elements if the total number of selected boxes is less than the output tensor size.
**Types**

View File

@ -72,7 +72,9 @@ class must not exceed `max_output_boxes_per_class`.
* **2**: `selected_scores` - tensor of type *T_THRESHOLDS* and shape `[number of selected boxes, 3]` containing information about scores for each selected box as triplets `[batch_index, class_index, box_score]`.
* **3**: `valid_outputs` - 1D tensor with 1 element of type *T_IND* representing the total number of selected boxes. Optional.
* **3**: `valid_outputs` - 1D tensor with 1 element of type *T_IND* representing the total number of selected boxes.
Plugins which do not support dynamic output tensors produce `selected_indices` and `selected_scores` tensors of shape `[min(num_boxes, max_output_boxes_per_class) * num_batches * num_classes, 3]` which is an upper bound for the number of possible selected boxes. Output tensor elements following the really selected boxes are filled with value -1.
**Types**

View File

@ -10,7 +10,7 @@
* *axis*
* **Description**: Specifies the axis along which
* **Description**: Specifies the axis along which the values are retrieved.
* **Range of values**: An integer. Negative value means counting dimension from the end.
* **Type**: `int`
* **Default value**: None
@ -50,7 +50,15 @@ Output tensor is populated by values computes in the following way:
output[i1, ..., i(axis-1), j, i(axis+1) ..., iN] = top_k(input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]), k, sort, mode)
So for each slice `input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]` which represents 1D array, top_k value is computed individually. Sorting and minimum/maximum are controlled by `sort` and `mode` attributes.
So for each slice `input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]` which represents 1D array, top_k value is computed individually.
Sorting and minimum/maximum are controlled by `sort` and `mode` attributes:
* *mode*=`max`, *sort*=`value` - descending by value
* *mode*=`max`, *sort*=`index` - ascending by index
* *mode*=`max`, *sort*=`none` - undefined
* *mode*=`min`, *sort*=`value` - ascending by value
* *mode*=`min`, *sort*=`index` - ascending by index
* *mode*=`min`, *sort*=`none` - undefined
**Example**
@ -76,4 +84,4 @@ So for each slice `input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]` which repr
</port>
</output>
</layer>
```
```

View File

@ -10,7 +10,7 @@
* *axis*
* **Description**: Specifies the axis along which
* **Description**: Specifies the axis along which the values are retrieved.
* **Range of values**: An integer. Negative value means counting dimension from the end.
* **Type**: `int`
* **Default value**: None
@ -31,7 +31,7 @@
* **Type**: `string`
* **Default value**: None
* **Required**: *yes*
* *index_element_type*
* **Description**: the type of output tensor with indices
@ -51,7 +51,7 @@
* **1**: Output tensor of type *T* with top *k* values from the input tensor along specified dimension *axis*. The shape of the tensor is `[input1.shape[0], ..., input1.shape[axis-1], k, input1.shape[axis+1], ...]`.
* **2**: Output tensor with top *k* indices for each slice along *axis* dimension of type *T_IND*. The shape of the tensor is the same as for the 1st output, that is `[input1.shape[0], ..., input1.shape[axis-1], k, input1.shape[axis+1], ...]`
* **2**: Output tensor with top *k* indices for each slice along *axis* dimension of type *T_IND*. The shape of the tensor is the same as for the 1st output, that is `[input1.shape[0], ..., input1.shape[axis-1], k, input1.shape[axis+1], ...]`.
**Types**
@ -65,7 +65,15 @@ Output tensor is populated by values computes in the following way:
output[i1, ..., i(axis-1), j, i(axis+1) ..., iN] = top_k(input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]), k, sort, mode)
So for each slice `input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]` which represents 1D array, *TopK* value is computed individually. Sorting and minimum/maximum are controlled by `sort` and `mode` attributes.
So for each slice `input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]` which represents 1D array, *TopK* value is computed individually.
Sorting and minimum/maximum are controlled by `sort` and `mode` attributes:
* *mode*=`max`, *sort*=`value` - descending by value
* *mode*=`max`, *sort*=`index` - ascending by index
* *mode*=`max`, *sort*=`none` - undefined
* *mode*=`min`, *sort*=`value` - ascending by value
* *mode*=`min`, *sort*=`index` - ascending by index
* *mode*=`min`, *sort*=`none` - undefined
**Example**
@ -97,4 +105,4 @@ So for each slice `input[i1, ...., i(axis-1), :, i(axis+1), ..., iN]` which repr
</port>
</output>
</layer>
```
```

View File

@ -332,7 +332,7 @@ In many cases, a network expects a pre-processed image, so make sure you do not
- Model Optimizer can efficiently bake the mean and normalization (scale) values into the model (for example, weights of the first convolution). See <a href="#mo-knobs-related-to-performance">Model Optimizer Knobs Related to Performance</a>.
- If regular 8-bit per channel images are your native media (for instance, decoded frames), do not convert to the `FP32` on your side, as this is something that plugins can accelerate. Use the `InferenceEngine::Precision::U8` as your input format:<br>
@snippet openvino/docs/snippets/dldt_optimization_guide1.cpp part1
@snippet snippets/dldt_optimization_guide1.cpp part1
Note that in many cases, you can directly share the (input) data with the Inference Engine.
@ -342,15 +342,15 @@ The general approach for sharing data between Inference Engine and media/graphic
For Intel MSS, it is recommended to perform a viable pre-processing, for example, crop/resize, and then convert to RGB again with the [Video Processing Procedures (VPP)](https://software.intel.com/en-us/node/696108). Then lock the result and create an Inference Engine blob on top of that. The resulting pointer can be used for the `SetBlob`:
@snippet openvino/docs/snippets/dldt_optimization_guide2.cpp part2
@snippet snippets/dldt_optimization_guide2.cpp part2
**WARNING**: The `InferenceEngine::NHWC` layout is not supported natively by most InferenceEngine plugins so internal conversion might happen.
@snippet openvino/docs/snippets/dldt_optimization_guide3.cpp part3
@snippet snippets/dldt_optimization_guide3.cpp part3
Alternatively, you can use RGBP (planar RGB) output from Intel MSS. This allows to wrap the (locked) result as regular NCHW which is generally friendly for most plugins (unlike NHWC). Then you can use it with `SetBlob` just like in previous example:
@snippet openvino/docs/snippets/dldt_optimization_guide4.cpp part4
@snippet snippets/dldt_optimization_guide4.cpp part4
The only downside of this approach is that VPP conversion to RGBP is not hardware accelerated (and performed on the GPU EUs). Also, it is available only on LInux.
@ -362,7 +362,7 @@ Again, if the OpenCV and Inference Engine layouts match, the data can be wrapped
**WARNING**: The `InferenceEngine::NHWC` layout is not supported natively by most InferenceEngine plugins so internal conversion might happen.
@snippet openvino/docs/snippets/dldt_optimization_guide5.cpp part5
@snippet snippets/dldt_optimization_guide5.cpp part5
Notice that original `cv::Mat`/blobs cannot be used simultaneously by the application and the Inference Engine. Alternatively, the data that the pointer references to can be copied to unlock the original data and return ownership to the original API.
@ -372,7 +372,7 @@ Infer Request based API offers two types of request: Sync and Async. The Sync is
More importantly, an infer request encapsulates the reference to the “executable” network and actual inputs/outputs. Now, when you load the network to the plugin, you get a reference to the executable network (you may consider that as a queue). Actual infer requests are created by the executable network:
@snippet openvino/docs/snippets/dldt_optimization_guide6.cpp part6
@snippet snippets/dldt_optimization_guide6.cpp part6
`GetBlob` is a recommend way to communicate with the network, as it internally allocates the data with right padding/alignment for the device. For example, the GPU inputs/outputs blobs are mapped to the host (which is fast) if the `GetBlob` is used. But if you called the `SetBlob`, the copy (from/to the blob you have set) into the internal GPU plugin structures will happen.
@ -383,7 +383,7 @@ If your application simultaneously executes multiple infer requests:
- For the CPU, the best solution, you can use the <a href="#cpu-streams">CPU "throughput" mode</a>.
- If latency is of more concern, you can try the `EXCLUSIVE_ASYNC_REQUESTS` [configuration option](../IE_DG/supported_plugins/CPU.md) that limits the number of the simultaneously executed requests for all (executable) networks that share the specific device to just one:<br>
@snippet openvino/docs/snippets/dldt_optimization_guide7.cpp part7
@snippet snippets/dldt_optimization_guide7.cpp part7
<br>For more information on the executable networks notation, see <a href="#new-request-based-api">Request-Based API and “GetBlob” Idiom</a>.
@ -407,13 +407,13 @@ You can compare the pseudo-codes for the regular and async-based approaches:
- In the regular way, the frame is captured with OpenCV and then immediately processed:<br>
@snippet openvino/docs/snippets/dldt_optimization_guide8.cpp part8
@snippet snippets/dldt_optimization_guide8.cpp part8
![Intel&reg; VTune&trade; screenshot](../img/vtune_regular.png)
- In the "true" async mode, the `NEXT` request is populated in the main (application) thread, while the `CURRENT` request is processed:<br>
@snippet openvino/docs/snippets/dldt_optimization_guide9.cpp part9
@snippet snippets/dldt_optimization_guide9.cpp part9
![Intel&reg; VTune&trade; screenshot](../img/vtune_async.png)

View File

@ -54,4 +54,4 @@ if(NGRAPH_ONNX_IMPORT_ENABLE)
target_link_libraries(${TARGET_NAME} PRIVATE onnx_importer)
endif()
target_link_libraries(${TARGET_NAME} PRIVATE inference_engine_plugin_api ngraph)
target_link_libraries(${TARGET_NAME} PRIVATE inference_engine_plugin_api ngraph inference_engine_transformations)

View File

@ -5,6 +5,11 @@
#include <memory>
#include <ngraph/pattern/op/wrap_type.hpp>
#include <transformations/common_optimizations/common_optimizations.hpp>
#include <transformations/op_conversions/convert_gelu.hpp>
#include <transformations/op_conversions/convert_space_to_depth.hpp>
#include <transformations/op_conversions/convert_depth_to_space.hpp>
#include <transformations/op_conversions/convert_pad_to_group_conv.hpp>
// ! [ngraph:include]
#include <ngraph/ngraph.hpp>
@ -249,3 +254,61 @@ void visualization_example(std::shared_ptr<ngraph::Function> f) {
manager.run_passes(f);
}
// ! [ngraph:visualize]
void pass_manager_example1(std::shared_ptr<ngraph::Function> f) {
// ! [ngraph:disable_gelu]
ngraph::pass::Manager manager;
manager.register_pass<ngraph::pass::CommonOptimizations>();
auto pass_config = manager.get_pass_config();
pass_config->disable<ngraph::pass::ConvertGELU>();
manager.run_passes(f);
// ! [ngraph:disable_gelu]
}
void pass_manager_example2(std::shared_ptr<ngraph::Function> f) {
ngraph::pass::Manager manager;
std::function<bool(const std::shared_ptr<const Node>)> transformation_callback;
// ! [ngraph:disable_callback]
// Set callback to particular transformation with specific condition
auto pass_config = manager.get_pass_config();
pass_config->set_callback<ngraph::pass::ConvertSpaceToDepth,
ngraph::pass::ConvertDepthToSpace>(
[](const std::shared_ptr<const Node> &node) -> bool {
return node->input_value(0).get_shape().size() <= 5lu &&
node->input_value(0).get_shape().size() == node->get_output_shape(0).size();
});
// Update transformation to call callback
ngraph::matcher_pass_callback callback = [=](pattern::Matcher &m) {
auto node = m.get_match_root();
if (transformation_callback(node)) {
return false;
}
// transformation code
return false;
};
// ! [ngraph:disable_callback]
}
void pass_manager_example3(std::shared_ptr<ngraph::Function> f) {
std::function<bool(const std::shared_ptr<const Node>)> transformation_callback;
// ! [ngraph:disabled_by_default]
// Example of disabled by default transformation
{
ngraph::pass::Manager manager;
manager.register_pass<ngraph::pass::ConvertPadToGroupConvolution, false>();
manager.run_passes(f);
}
// Enable disabled by default transformation inside plugin
{
ngraph::pass::Manager manager;
manager.register_pass<ngraph::pass::CommonOptimizations>();
auto pass_config = manager.get_pass_config();
pass_config->enable<ngraph::pass::ConvertPadToGroupConvolution>();
manager.run_passes(f);
}
// ! [ngraph:disabled_by_default]
}

View File

@ -8,6 +8,8 @@ using namespace ngraph;
// ! [function_pass:template_transformation_cpp]
// template_function_transformation.cpp
NGRAPH_RTTI_DEFINITION(ngraph::pass::MyFunctionTransformation, "MyFunctionTransformation", 0);
bool pass::MyFunctionTransformation::run_on_function(std::shared_ptr<ngraph::Function> f) {
// Example transformation code
NodeVector nodes;

View File

@ -18,6 +18,7 @@ class MyFunctionTransformation;
// template_function_transformation.hpp
class ngraph::pass::MyFunctionTransformation: public ngraph::pass::FunctionPass {
public:
NGRAPH_RTTI_DECLARATION;
bool run_on_function(std::shared_ptr<ngraph::Function> f) override;
};
// ! [function_pass:template_transformation_hpp]

View File

@ -14,6 +14,8 @@ using namespace ngraph;
// ! [graph_rewrite:template_transformation_cpp]
// template_pattern_transformation.cpp
NGRAPH_RTTI_DEFINITION(ngraph::pass::DecomposeDivideMatcher, "DecomposeDivideMatcher", 0);
ngraph::pass::DecomposeDivideMatcher::DecomposeDivideMatcher() {
// Pattern example
auto input0 = pattern::any_input();
@ -54,6 +56,8 @@ ngraph::pass::DecomposeDivideMatcher::DecomposeDivideMatcher() {
// ! [graph_rewrite:template_transformation_cpp]
// ! [matcher_pass:relu_fusion]
NGRAPH_RTTI_DEFINITION(ngraph::pass::ReluReluFusionMatcher, "ReluReluFusionMatcher", 0);
ngraph::pass::ReluReluFusionMatcher::ReluReluFusionMatcher() {
auto m_relu1 = ngraph::pattern::wrap_type<ngraph::opset3::Relu>(pattern::consumers_count(1));
auto m_relu2 = ngraph::pattern::wrap_type<ngraph::opset3::Relu>({m_relu1});

View File

@ -23,11 +23,13 @@ class ReluReluFusionMatcher;
*/
class ngraph::pass::DecomposeDivideMatcher: public ngraph::pass::MatcherPass {
public:
NGRAPH_RTTI_DECLARATION;
DecomposeDivideMatcher();
};
// ! [graph_rewrite:template_transformation_hpp]
class ngraph::pass::ReluReluFusionMatcher: public ngraph::pass::MatcherPass {
public:
NGRAPH_RTTI_DECLARATION;
ReluReluFusionMatcher();
};

View File

@ -180,6 +180,8 @@ endif()
#
ie_developer_export_targets(format_reader)
ie_developer_export_targets(ie_samples_utils)
ie_developer_export_targets(gflags)
ie_developer_export_targets(${NGRAPH_LIBRARIES})
# for Template plugin

View File

@ -181,8 +181,8 @@ endif ()
if (ENABLE_OPENCV)
reset_deps_cache(OpenCV_DIR)
set(OPENCV_VERSION "4.5.0")
set(OPENCV_BUILD "36")
set(OPENCV_VERSION "4.5.1")
set(OPENCV_BUILD "044")
set(OPENCV_BUILD_YOCTO "337")
if (AARCH64)
@ -308,22 +308,22 @@ if (ENABLE_SPEECH_DEMO)
if(DEFINED IE_PATH_TO_DEPS)
if (WIN32 AND X86_64)
RESOLVE_DEPENDENCY(SPEECH_LIBS_AND_DEMOS
ARCHIVE_WIN "speech_demo_1.0.0.754_windows.zip"
ARCHIVE_WIN "speech_demo_1.0.0.755_windows.zip"
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*"
TARGET_PATH "${TEMP}/speech_demo_1.0.0.754")
TARGET_PATH "${TEMP}/speech_demo_1.0.0.755")
debug_message(STATUS "speech_libs_and_demos=" ${SPEECH_LIBS_AND_DEMOS})
elseif (LINUX AND X86_64)
if (LINUX_OS_NAME STREQUAL "CentOS 7" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
RESOLVE_DEPENDENCY(SPEECH_LIBS_AND_DEMOS
ARCHIVE_LIN "speech_demo_1.0.0.754_centos.tgz"
ARCHIVE_LIN "speech_demo_1.0.0.755_centos.tgz"
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*"
TARGET_PATH "${TEMP}/speech_demo_1.0.0.754")
TARGET_PATH "${TEMP}/speech_demo_1.0.0.755")
debug_message(STATUS "speech_libs_and_demos=" ${SPEECH_LIBS_AND_DEMOS})
else()
RESOLVE_DEPENDENCY(SPEECH_LIBS_AND_DEMOS
ARCHIVE_LIN "speech_demo_1.0.0.754_linux.tgz"
ARCHIVE_LIN "speech_demo_1.0.0.755_linux.tgz"
VERSION_REGEX ".*_([0-9]+.[0-9]+.[0-9]+.[0-9]+).*"
TARGET_PATH "${TEMP}/speech_demo_1.0.0.754")
TARGET_PATH "${TEMP}/speech_demo_1.0.0.755")
debug_message(STATUS "speech_libs_and_demos=" ${SPEECH_LIBS_AND_DEMOS})
endif()
else()

View File

@ -98,6 +98,8 @@ ie_option (ENABLE_PYTHON "enables ie python bridge build" OFF)
ie_option (ENABLE_V7_SERIALIZE "enables serialization to IR v7" OFF)
ie_option (ENABLE_V10_SERIALIZE "enables experimental serialization to IR v10" OFF)
ie_option (ENABLE_JAVA "enables ie java bridge build" OFF)
ie_dependent_option(ENABLE_CPPLINT "Enable cpplint checks during the build" ON "UNIX;NOT ANDROID" OFF)

View File

@ -7,6 +7,7 @@ function(set_ie_threading_interface_for TARGET_NAME)
find_package(TBB COMPONENTS tbb tbbmalloc)
set("TBB_FOUND" ${TBB_FOUND} PARENT_SCOPE)
set("TBB_IMPORTED_TARGETS" ${TBB_IMPORTED_TARGETS} PARENT_SCOPE)
set("TBB_VERSION" ${TBB_VERSION} PARENT_SCOPE)
if (TBB_FOUND)
if (TBB_VERSION VERSION_LESS 2020)
ext_message(WARNING "TBB version is less than OpenVINO recommends to use.\

View File

@ -13,13 +13,13 @@ endif()
include(dependency_solver)
set(VPU_SUPPORTED_FIRMWARES usb-ma2x8x pcie-ma248x)
set(VPU_SUPPORTED_FIRMWARES usb-ma2x8x pcie-ma2x8x)
#
# Default packages
#
set(FIRMWARE_PACKAGE_VERSION 1492)
set(FIRMWARE_PACKAGE_VERSION 1522)
set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.2")
#
@ -31,7 +31,7 @@ foreach(firmware_name IN LISTS VPU_SUPPORTED_FIRMWARES)
set(firmware_name_full ${firmware_name}.mvcmd)
# Handle PCIe elf firmware for Windows
if (WIN32 AND "${firmware_name}" STREQUAL "pcie-ma248x")
if (WIN32 AND "${firmware_name}" STREQUAL "pcie-ma2x8x")
set(firmware_name_full ${firmware_name}.elf)
endif ()
@ -69,7 +69,7 @@ foreach(firmware_name IN LISTS VPU_SUPPORTED_FIRMWARES)
set(firmware_out_file "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${firmware_name}.mvcmd")
# Handle PCIe elf firmware for Windows
if (WIN32 AND "${firmware_name}" STREQUAL "pcie-ma248x")
if (WIN32 AND "${firmware_name}" STREQUAL "pcie-ma2x8x")
set(firmware_out_file "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${firmware_name}.elf")
endif ()

View File

@ -45,7 +45,7 @@
#endif
#ifndef INFERENCE_ENGINE_C_API_CALLBACK
#define INFERENCE_ENGINE_C_API_CALLBACK
#define INFERENCE_ENGINE_C_API_CALLBACK
#endif
typedef struct ie_core ie_core_t;
@ -59,39 +59,39 @@ typedef struct ie_blob ie_blob_t;
* @brief Represents an API version information that reflects the set of supported features
*/
typedef struct ie_version {
char *api_version;
}ie_version_t;
char *api_version; //!< A string representing Inference Engine version
} ie_version_t;
/**
* @struct ie_core_version
* @brief Represents version information that describes devices and the inference engine runtime library
*/
typedef struct ie_core_version {
size_t major;
size_t minor;
const char *device_name;
const char *build_number;
const char *description;
}ie_core_version_t;
size_t major; //!< A major version
size_t minor; //!< A minor version
const char *device_name; //!< A device name
const char *build_number; //!< A build number
const char *description; //!< A device description
} ie_core_version_t;
/**
* @struct ie_core_versions
* @brief Represents all versions information that describes all devices and the inference engine runtime library
*/
typedef struct ie_core_versions {
ie_core_version_t *versions;
size_t num_vers;
}ie_core_versions_t;
ie_core_version_t *versions; //!< An array of device versions
size_t num_vers; //!< A number of versions in the array
} ie_core_versions_t;
/**
* @struct ie_config
* @brief Represents configuration information that describes devices
*/
typedef struct ie_config {
const char *name;
const char *value;
struct ie_config *next;
}ie_config_t;
const char *name; //!< A configuration key
const char *value; //!< A configuration value
struct ie_config *next; //!< A pointer to the next configuration value
} ie_config_t;
/**
* @struct ie_param
@ -99,12 +99,12 @@ typedef struct ie_config {
*/
typedef struct ie_param {
union {
char *params;
unsigned int number;
unsigned int range_for_async_infer_request[3];
unsigned int range_for_streams[2];
char *params;
unsigned int number;
unsigned int range_for_async_infer_request[3];
unsigned int range_for_streams[2];
};
}ie_param_t;
} ie_param_t;
/**
* @struct ie_param_config
@ -113,57 +113,57 @@ typedef struct ie_param {
typedef struct ie_param_config {
char *name;
ie_param_t *param;
}ie_param_config_t;
} ie_param_config_t;
/**
* @struct desc
* @brief Represents detailed information for an error
*/
typedef struct desc {
char msg[256];
}desc_t;
char msg[256]; //!< A description message
} desc_t;
/**
* @struct dimensions
* @brief Represents dimensions for input or output data
*/
typedef struct dimensions {
size_t ranks;
size_t dims[8];
}dimensions_t;
size_t ranks; //!< A runk representing a number of dimensions
size_t dims[8]; //!< An array of dimensions
} dimensions_t;
/**
* @enum layout_e
* @brief Layouts that the inference engine supports
*/
typedef enum {
ANY = 0, // "any" layout
ANY = 0, //!< "ANY" layout
// I/O data layouts
NCHW = 1,
NHWC = 2,
NCDHW = 3,
NDHWC = 4,
NCHW = 1, //!< "NCHW" layout
NHWC = 2, //!< "NHWC" layout
NCDHW = 3, //!< "NCDHW" layout
NDHWC = 4, //!< "NDHWC" layout
// weight layouts
OIHW = 64,
OIHW = 64, //!< "OIHW" layout
// Scalar
SCALAR = 95,
SCALAR = 95, //!< "SCALAR" layout
// bias layouts
C = 96,
C = 96, //!< "C" layout
// Single image layout (for mean image)
CHW = 128,
CHW = 128, //!< "CHW" layout
// 2D
HW = 192,
NC = 193,
CN = 194,
HW = 192, //!< "HW" layout
NC = 193, //!< "NC" layout
CN = 194, //!< "CN" layout
BLOCKED = 200,
}layout_e;
BLOCKED = 200, //!< "BLOCKED" layout
} layout_e;
/**
* @enum precision_e
@ -185,7 +185,7 @@ typedef enum {
U32 = 74, /**< 32bit unsigned integer value */
BIN = 71, /**< 1bit integer value */
CUSTOM = 80 /**< custom precision has it's own name and size of elements */
}precision_e;
} precision_e;
/**
* @struct tensor_desc
@ -195,31 +195,31 @@ typedef struct tensor_desc {
layout_e layout;
dimensions_t dims;
precision_e precision;
}tensor_desc_t;
} tensor_desc_t;
/**
* @enum colorformat_e
* @brief Extra information about input color format for preprocessing
*/
typedef enum {
RAW = 0u, ///< Plain blob (default), no extra color processing required
RGB, ///< RGB color format
BGR, ///< BGR color format, default in DLDT
RGBX, ///< RGBX color format with X ignored during inference
BGRX, ///< BGRX color format with X ignored during inference
NV12, ///< NV12 color format represented as compound Y+UV blob
I420, ///< I420 color format represented as compound Y+U+V blob
}colorformat_e;
RAW = 0u, //!< Plain blob (default), no extra color processing required
RGB, //!< RGB color format
BGR, //!< BGR color format, default in DLDT
RGBX, //!< RGBX color format with X ignored during inference
BGRX, //!< BGRX color format with X ignored during inference
NV12, //!< NV12 color format represented as compound Y+UV blob
I420, //!< I420 color format represented as compound Y+U+V blob
} colorformat_e;
/**
* @enum resize_alg_e
* @brief Represents the list of supported resize algorithms.
*/
typedef enum {
NO_RESIZE = 0,
RESIZE_BILINEAR,
RESIZE_AREA
}resize_alg_e;
NO_RESIZE = 0, //!< "No resize" mode
RESIZE_BILINEAR, //!< "Bilinear resize" mode
RESIZE_AREA //!< "Area resize" mode
} resize_alg_e;
/**
* @enum IEStatusCode
@ -242,19 +242,19 @@ typedef enum {
NOT_ALLOCATED = -10,
INFER_NOT_STARTED = -11,
NETWORK_NOT_READ = -12
}IEStatusCode;
} IEStatusCode;
/**
* @struct roi_t
* @brief This structure describes roi data.
*/
typedef struct roi {
size_t id; // ID of a roi
size_t posX; // W upper left coordinate of roi
size_t posY; // H upper left coordinate of roi
size_t sizeX; // W size of roi
size_t sizeY; // H size of roi
}roi_t;
size_t id; //!< ID of a roi
size_t posX; //!< W upper left coordinate of roi
size_t posY; //!< H upper left coordinate of roi
size_t sizeX; //!< W size of roi
size_t sizeY; //!< H size of roi
} roi_t;
/**
* @struct input_shape
@ -263,7 +263,7 @@ typedef struct roi {
typedef struct input_shape {
char *name;
dimensions_t shape;
}input_shape_t;
} input_shape_t;
/**
* @struct input_shapes
@ -272,7 +272,7 @@ typedef struct input_shape {
typedef struct input_shapes {
input_shape_t *shapes;
size_t shape_num;
}input_shapes_t;
} input_shapes_t;
/**
* @struct ie_blob_buffer
@ -280,10 +280,10 @@ typedef struct input_shapes {
*/
typedef struct ie_blob_buffer {
union {
void *buffer; // buffer can be written
const void *cbuffer; // cbuffer is read-only
void *buffer; //!< buffer can be written
const void *cbuffer; //!< cbuffer is read-only
};
}ie_blob_buffer_t;
} ie_blob_buffer_t;
/**
* @struct ie_complete_call_back
@ -292,7 +292,7 @@ typedef struct ie_blob_buffer {
typedef struct ie_complete_call_back {
void (INFERENCE_ENGINE_C_API_CALLBACK *completeCallBackFunc)(void *args);
void *args;
}ie_complete_call_back_t;
} ie_complete_call_back_t;
/**
* @struct ie_available_devices
@ -301,7 +301,7 @@ typedef struct ie_complete_call_back {
typedef struct ie_available_devices {
char **devices;
size_t num_devices;
}ie_available_devices_t;
} ie_available_devices_t;
/**
* @brief Returns number of version that is exported. Use the ie_version_free() to free memory.
@ -317,7 +317,7 @@ INFERENCE_ENGINE_C_API(void) ie_version_free(ie_version_t *version);
/**
* @brief Release the memory allocated by ie_param_t.
* @param version A pointer to the ie_param_t to free memory.
* @param param A pointer to the ie_param_t to free memory.
*/
INFERENCE_ENGINE_C_API(void) ie_param_free(ie_param_t *param);
@ -662,6 +662,7 @@ INFERENCE_ENGINE_C_API(void) ie_network_free(ie_network_t **network);
/**
* @brief Get name of network.
* @ingroup Network
* @param network A pointer to the instance of the ie_network_t to get a name from.
* @param name Name of the network.
* @return Status code of the operation: OK(0) for success.
*/
@ -729,7 +730,7 @@ INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_layout(co
INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_set_input_layout(ie_network_t *network, const char *input_name, const layout_e l);
/**
* @Gets dimensions/shape of the input data with reversed order.
* @brief Gets dimensions/shape of the input data with reversed order.
* @ingroup Network
* @param network A pointer to ie_network_t instance.
* @param input_name Name of input data.
@ -743,11 +744,10 @@ INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_dims(cons
* @ingroup Network
* @param network A pointer to ie_network_t instance.
* @param input_name Name of input data.
* @parm resize_alg_result The pointer to the resize algorithm used for input blob creation.
* @param resize_alg_result The pointer to the resize algorithm used for input blob creation.
* @return Status code of the operation: OK(0) for success.
*/
INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_resize_algorithm(const ie_network_t *network, const char *input_name, \
resize_alg_e *resize_alg_result);
INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_resize_algorithm(const ie_network_t *network, const char *input_name, resize_alg_e *resize_alg_result);
/**
* @brief Sets resize algorithm to be used during pre-processing
@ -1014,7 +1014,7 @@ INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_get_layout(const ie_bl
INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_get_precision(const ie_blob_t *blob, precision_e *prec_result);
/**
* @Releases the memory occupied by the ie_blob_t pointer.
* @brief Releases the memory occupied by the ie_blob_t pointer.
* @ingroup Blob
* @param blob A pointer to the blob pointer to release memory.
*/

View File

@ -1,4 +1,4 @@
# nGraph Function Python* Sample {#openvino_inference_engine_samples_ngraph_function_creation_sample_README}
# nGraph Function Python* Sample {#openvino_inference_engine_ie_bridges_python_samples_ngraph_function_creation_sample_README}
This sample demonstrates how to execute an inference using ngraph::Function to create a network. The sample uses the LeNet classifications network as an example.

View File

@ -123,7 +123,6 @@ public:
* Wraps ICNNNetwork::setBatchSize
*
* @param size Size of batch to set
* @return Status code of the operation
*/
virtual void setBatchSize(const size_t size) {
CALL_STATUS_FNC(setBatchSize, size);

View File

@ -83,7 +83,7 @@ public:
/**
* constructs InferRequest from the initialized shared_pointer
* @param request Initialized shared pointer to IInferRequest interface
* @param plg Plugin to use. This is required to ensure that InferRequest can work properly even if plugin object is destroyed.
* @param splg Plugin to use. This is required to ensure that InferRequest can work properly even if plugin object is destroyed.
*/
explicit InferRequest(IInferRequest::Ptr request,
InferenceEngine::details::SharedObjectLoader::Ptr splg = {}):

View File

@ -3,7 +3,9 @@
//
/**
* @file
* @brief A header file that provides wrapper classes for IVariableState
*
* @file ie_memory_state.hpp
*/
#pragma once
@ -25,8 +27,9 @@ class VariableState {
public:
/**
* constructs VariableState from the initialized shared_pointer
* @brief constructs VariableState from the initialized shared_pointer
* @param pState Initialized shared pointer
* @param plg Optional: Plugin to use. This is required to ensure that VariableState can work properly even if plugin object is destroyed.
*/
explicit VariableState(IVariableState::Ptr pState, details::SharedObjectLoader::Ptr plg = {}) : actual(pState), plugin(plg) {
if (actual == nullptr) {
@ -59,7 +62,7 @@ public:
* @copybrief IVariableState::GetState
*
* Wraps IVariableState::GetState
* @return A blob representing a last state
* @return A blob representing a state
*/
Blob::CPtr GetState() const {
Blob::CPtr stateBlob;
@ -67,7 +70,14 @@ public:
return stateBlob;
}
INFERENCE_ENGINE_DEPRECATED("Use GetState function instead")
/**
* @copybrief IVariableState::GetLastState
* @deprecated Use IVariableState::SetState instead
*
* Wraps IVariableState::GetLastState
* @return A blob representing a last state
*/
INFERENCE_ENGINE_DEPRECATED("Use VariableState::GetState function instead")
Blob::CPtr GetLastState() const {
return GetState();
}
@ -83,8 +93,9 @@ public:
}
};
/*
/**
* @brief For compatibility reasons.
*/
using MemoryState = VariableState;
} // namespace InferenceEngine

View File

@ -22,17 +22,17 @@ namespace InferenceEngine {
namespace gpu {
/**
* @brief This class represents an abstraction for GPU plugin remote context
* which is shared with Direct3D 11 device.
* The plugin object derived from this class can be obtained either with
* GetContext() method of Executable network or using CreateContext() Core call.
* @note User can also obtain OpenCL context handle from this class.
*/
* @brief This class represents an abstraction for GPU plugin remote context
* which is shared with Direct3D 11 device.
* The plugin object derived from this class can be obtained either with
* GetContext() method of Executable network or using CreateContext() Core call.
* @note User can also obtain OpenCL context handle from this class.
*/
class D3DContext : public ClContext {
public:
/**
* @brief A smart pointer to the D3DContext object
*/
* @brief A smart pointer to the D3DContext object
*/
using Ptr = std::shared_ptr<D3DContext>;
/**
@ -47,16 +47,16 @@ public:
};
/**
* @brief This class represents an abstraction for GPU plugin remote blob
* which is shared with Direct3D 11 buffer.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can also obtain OpenCL buffer handle from this class.
*/
* @brief This class represents an abstraction for GPU plugin remote blob
* which is shared with Direct3D 11 buffer.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can also obtain OpenCL buffer handle from this class.
*/
class D3DBufferBlob : public ClBufferBlob {
public:
/**
* @brief A smart pointer to the D3DBufferBlob object
*/
* @brief A smart pointer to the D3DBufferBlob object
*/
using Ptr = std::shared_ptr<D3DBufferBlob>;
/**
@ -77,16 +77,16 @@ public:
};
/**
* @brief This class represents an abstraction for GPU plugin remote blob
* which is shared with Direct3D 11 2D texture.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can also obtain OpenCL 2D image handle from this class.
*/
* @brief This class represents an abstraction for GPU plugin remote blob
* which is shared with Direct3D 11 2D texture.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can also obtain OpenCL 2D image handle from this class.
*/
class D3DSurface2DBlob : public ClImage2DBlob {
public:
/**
* @brief A smart pointer to the D3DSurface2DBlob object
*/
* @brief A smart pointer to the D3DSurface2DBlob object
*/
using Ptr = std::shared_ptr<D3DSurface2DBlob>;
/**
@ -117,9 +117,14 @@ public:
};
/**
* @brief This function is used to obtain a NV12 compound blob object from NV12 DXGI video decoder output.
* The resulting compound contains two remote blobs for Y and UV planes of the surface.
*/
* @brief This function is used to obtain a NV12 compound blob object from NV12 DXGI video decoder output.
* The resulting compound contains two remote blobs for Y and UV planes of the surface.
* @param height Height of Y plane
* @param width Widht of Y plane
* @param ctx A pointer to remote context
* @param nv12_surf A ID3D11Texture2D instance to create NV12 blob from
* @return NV12 remote blob
*/
static inline Blob::Ptr make_shared_blob_nv12(size_t height, size_t width, RemoteContext::Ptr ctx, ID3D11Texture2D* nv12_surf) {
auto casted = std::dynamic_pointer_cast<D3DContext>(ctx);
if (nullptr == casted) {
@ -145,8 +150,12 @@ static inline Blob::Ptr make_shared_blob_nv12(size_t height, size_t width, Remot
}
/**
* @brief This function is used to obtain remote context object from ID3D11Device
*/
* @brief This function is used to obtain remote context object from ID3D11Device
* @param core Inference Engine Core object instance
* @param deviceName A name of to create a remote context for
* @param device A pointer to ID3D11Device to be used to create a remote context
* @return A shared remote context instance
*/
static inline D3DContext::Ptr make_shared_context(Core& core, std::string deviceName, ID3D11Device* device) {
ParamMap contextParams = {
{ GPU_PARAM_KEY(CONTEXT_TYPE), GPU_PARAM_VALUE(VA_SHARED) },
@ -156,8 +165,12 @@ static inline D3DContext::Ptr make_shared_context(Core& core, std::string device
}
/**
* @brief This function is used to obtain remote blob object from ID3D11Buffer
*/
* @brief This function is used to obtain remote blob object from ID3D11Buffer
* @param desc A tensor description which describes blob configuration
* @param ctx A shared pointer to a remote context
* @param buffer A pointer to ID3D11Buffer instance to create remote blob based on
* @return A remote blob instance
*/
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, ID3D11Buffer* buffer) {
auto casted = std::dynamic_pointer_cast<D3DContext>(ctx);
if (nullptr == casted) {
@ -172,14 +185,14 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::
}
/**
* @brief This function is used to obtain remote blob object from ID3D11Texture2D
* @param desc Tensor description
* @param ctx the RemoteContext object whuch owns context for the blob to be created
* @param surface Pointer to ID3D11Texture2D interface of the objects that owns NV12 texture
* @param plane ID of the plane to be shared (0 or 1)
* @return Smart pointer to created RemoteBlob object cast to base class
* @note The underlying ID3D11Texture2D can also be a plane of output surface of DXGI video decoder
*/
* @brief This function is used to obtain remote blob object from ID3D11Texture2D
* @param desc Tensor description
* @param ctx the RemoteContext object whuch owns context for the blob to be created
* @param surface Pointer to ID3D11Texture2D interface of the objects that owns NV12 texture
* @param plane ID of the plane to be shared (0 or 1)
* @return Smart pointer to created RemoteBlob object cast to base class
* @note The underlying ID3D11Texture2D can also be a plane of output surface of DXGI video decoder
*/
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, ID3D11Texture2D* surface, uint32_t plane = 0) {
auto casted = std::dynamic_pointer_cast<D3DContext>(ctx);
if (nullptr == casted) {

View File

@ -25,16 +25,16 @@ namespace InferenceEngine {
namespace gpu {
/**
* @brief This class represents an abstraction for GPU plugin remote context
* which is shared with OpenCL context object.
* The plugin object derived from this class can be obtained either with
* GetContext() method of Executable network or using CreateContext() Core call.
*/
* @brief This class represents an abstraction for GPU plugin remote context
* which is shared with OpenCL context object.
* The plugin object derived from this class can be obtained either with
* GetContext() method of Executable network or using CreateContext() Core call.
*/
class ClContext : public RemoteContext, public details::param_map_obj_getter {
public:
/**
* @brief A smart pointer to the ClContext object
*/
* @brief A smart pointer to the ClContext object
*/
using Ptr = std::shared_ptr<ClContext>;
/**
@ -63,14 +63,14 @@ public:
};
/**
* @brief The basic class for all GPU plugin remote blob objects.
* The OpenCL memory object handle (cl_mem) can be obtained from this class object.
*/
* @brief The basic class for all GPU plugin remote blob objects.
* The OpenCL memory object handle (cl_mem) can be obtained from this class object.
*/
class ClBlob : public RemoteBlob {
public:
/**
* @brief A smart pointer to the ClBlob object
*/
* @brief A smart pointer to the ClBlob object
*/
using Ptr = std::shared_ptr<ClBlob>;
/**
@ -81,16 +81,16 @@ public:
};
/**
* @brief This class represents an abstraction for GPU plugin remote blob
* which can be shared with user-supplied OpenCL buffer.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can obtain OpenCL buffer handle from this class.
*/
* @brief This class represents an abstraction for GPU plugin remote blob
* which can be shared with user-supplied OpenCL buffer.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can obtain OpenCL buffer handle from this class.
*/
class ClBufferBlob : public ClBlob, public details::param_map_obj_getter {
public:
/**
* @brief A smart pointer to the ClBufferBlob object
*/
* @brief A smart pointer to the ClBufferBlob object
*/
using Ptr = std::shared_ptr<ClBufferBlob>;
/**
@ -124,16 +124,16 @@ public:
};
/**
* @brief This class represents an abstraction for GPU plugin remote blob
* which can be shared with user-supplied OpenCL 2D Image.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can obtain OpenCL image handle from this class.
*/
* @brief This class represents an abstraction for GPU plugin remote blob
* which can be shared with user-supplied OpenCL 2D Image.
* The plugin object derived from this class can be obtained with CreateBlob() call.
* @note User can obtain OpenCL image handle from this class.
*/
class ClImage2DBlob : public ClBlob, public details::param_map_obj_getter {
public:
/**
* @brief A smart pointer to the ClImage2DBlob object
*/
* @brief A smart pointer to the ClImage2DBlob object
*/
using Ptr = std::shared_ptr<ClImage2DBlob>;
/**
@ -167,13 +167,13 @@ public:
};
/**
* @brief This function is used to construct a NV12 compound blob object from two cl::Image2D wrapper objects.
* The resulting compound contains two remote blobs for Y and UV planes of the surface.
* @param ctx RemoteContext plugin object derived from ClContext class.
* @param nv12_image_plane_y cl::Image2D object containing Y plane data.
* @param nv12_image_plane_uv cl::Image2D object containing UV plane data.
* @return Pointer to plugin-specific context class object, which is derived from RemoteContext.
*/
* @brief This function is used to construct a NV12 compound blob object from two cl::Image2D wrapper objects.
* The resulting compound contains two remote blobs for Y and UV planes of the surface.
* @param ctx RemoteContext plugin object derived from ClContext class.
* @param nv12_image_plane_y cl::Image2D object containing Y plane data.
* @param nv12_image_plane_uv cl::Image2D object containing UV plane data.
* @return A shared remote blob instance
*/
static inline Blob::Ptr make_shared_blob_nv12(RemoteContext::Ptr ctx, cl::Image2D& nv12_image_plane_y, cl::Image2D& nv12_image_plane_uv) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {
@ -201,8 +201,12 @@ static inline Blob::Ptr make_shared_blob_nv12(RemoteContext::Ptr ctx, cl::Image2
}
/**
* @brief This function is used to obtain remote context object from user-supplied OpenCL context handle
*/
* @brief This function is used to obtain remote context object from user-supplied OpenCL context handle
* @param core A reference to Inference Engine Core object
* @param deviceName A name of device to create a remote context for
* @param ctx A OpenCL context to be used to create shared remote context
* @return A shared remote context instance
*/
static inline RemoteContext::Ptr make_shared_context(Core& core, std::string deviceName, cl_context ctx) {
ParamMap contextParams = {
{ GPU_PARAM_KEY(CONTEXT_TYPE), GPU_PARAM_VALUE(OCL) },
@ -212,15 +216,22 @@ static inline RemoteContext::Ptr make_shared_context(Core& core, std::string dev
}
/**
* @brief This function is used to create remote blob object within default GPU plugin OpenCL context
*/
* @brief This function is used to create remote blob object within default GPU plugin OpenCL context
* @param desc A tensor descriptor object representing remote blob configuration
* @param ctx A remote context used to create remote blob
* @return A remote blob instance
*/
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, ClContext::Ptr ctx) {
return std::dynamic_pointer_cast<Blob>(ctx->CreateBlob(desc));
}
/**
* @brief This function is used to obtain remote blob object from user-supplied cl::Buffer wrapper object
*/
* @brief This function is used to obtain remote blob object from user-supplied cl::Buffer wrapper object
* @param desc A tensor descriptor object representing remote blob configuration
* @param ctx A remote context used to create remote blob
* @param buffer A cl::Buffer object wrapped by a remote blob
* @return A remote blob instance
*/
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl::Buffer& buffer) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {
@ -235,8 +246,12 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::
}
/**
* @brief This function is used to obtain remote blob object from user-supplied OpenCL buffer handle
*/
* @brief This function is used to obtain remote blob object from user-supplied OpenCL buffer handle
* @param desc A tensor descriptor object representing remote blob configuration
* @param ctx A remote context used to create remote blob
* @param buffer A cl_mem object wrapped by a remote blob
* @return A remote blob instance
*/
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl_mem buffer) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {
@ -251,8 +266,12 @@ static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::
}
/**
* @brief This function is used to obtain remote blob object from user-supplied cl::Image2D wrapper object
*/
* @brief This function is used to obtain remote blob object from user-supplied cl::Image2D wrapper object
* @param desc A tensor descriptor object representing remote blob configuration
* @param ctx A remote context used to create remote blob
* @param buffer A cl::Image2D object wrapped by a remote blob
* @return A remote blob instance
*/
static inline Blob::Ptr make_shared_blob(const TensorDesc& desc, RemoteContext::Ptr ctx, cl::Image2D& image) {
auto casted = std::dynamic_pointer_cast<ClContext>(ctx);
if (nullptr == casted) {

View File

@ -125,6 +125,7 @@ public:
/**
* @brief Returns the tensor description
* @return A const reference to a tensor descriptor
*/
virtual const TensorDesc& getTensorDesc() const noexcept {
return tensorDesc;
@ -132,6 +133,7 @@ public:
/**
* @brief Returns the tensor description
* @return A reference to a tensor descriptor
*/
virtual TensorDesc& getTensorDesc() noexcept {
return tensorDesc;
@ -141,6 +143,8 @@ public:
* @brief By default, returns the total number of elements (a product of all the dims or 1 for scalar)
*
* Return value and its interpretation heavily depend on the blob type
*
* @return The total number of elements
*/
virtual size_t size() const noexcept {
if (tensorDesc.getLayout() == Layout::SCALAR) return 1;
@ -149,6 +153,7 @@ public:
/**
* @brief Returns the size of the current Blob in bytes.
* @return Blob's size in bytes
*/
virtual size_t byteSize() const noexcept {
return size() * element_size();
@ -158,9 +163,11 @@ public:
* @deprecated Cast to MemoryBlob and use its API instead.
* Blob class can represent compound blob, which do not refer to the only solid memory.
*
* @brief Returns the number of bytes per element.
* @brief Provides the number of bytes per element.
*
* The overall Blob capacity is size() * element_size(). Abstract method.
*
* @return Returns the number of bytes per element
*/
virtual size_t element_size() const noexcept = 0;
@ -175,6 +182,8 @@ public:
* @brief Releases previously allocated data.
*
* Abstract method.
*
* @return `True` if deallocation happens successfully, `false` otherwise.
*/
virtual bool deallocate() noexcept = 0;
@ -243,13 +252,14 @@ protected:
*/
virtual void* getHandle() const noexcept = 0;
/// private
template <typename>
friend class TBlobProxy;
};
/**
* @brief Helper cast function to work with shared Blob objects
*
* @param blob A blob to cast
* @return shared_ptr to the type T. Returned shared_ptr shares ownership of the object with the
* input Blob::Ptr
*/
@ -262,7 +272,7 @@ std::shared_ptr<T> as(const Blob::Ptr& blob) noexcept {
/**
* @brief Helper cast function to work with shared Blob objects
*
* @param blob A blob to cast
* @return shared_ptr to the type const T. Returned shared_ptr shares ownership of the object with
* the input Blob::Ptr
*/
@ -320,6 +330,7 @@ public:
/**
* @brief Returns the total number of elements, which is a product of all the dimensions
* @return The total number of elements
*/
size_t size() const noexcept override {
if (tensorDesc.getLayout() == Layout::SCALAR) return 1;
@ -464,6 +475,7 @@ protected:
*/
void* getHandle() const noexcept override = 0;
/// private
template <typename>
friend class TBlobProxy;
};
@ -779,6 +791,11 @@ protected:
return _handle.get();
}
/**
* @brief Creates a blob from the existing blob with a given ROI
* @param origBlob An original blob
* @param roi A ROI object
*/
TBlob(const TBlob& origBlob, const ROI& roi) :
MemoryBlob(make_roi_desc(origBlob.getTensorDesc(), roi, true)),
_allocator(origBlob._allocator) {

View File

@ -91,6 +91,13 @@ enum Layout : uint8_t {
BLOCKED = 200, //!< A blocked layout
};
/**
* @brief Prints a string representation of InferenceEngine::Layout to a stream
* @param out An output stream to send to
* @param p A layout value to print to a stream
* @return A reference to the `out` stream
*/
inline std::ostream& operator<<(std::ostream& out, const Layout& p) {
switch (p) {
#define PRINT_LAYOUT(name) \
@ -131,6 +138,13 @@ enum ColorFormat : uint32_t {
NV12, ///< NV12 color format represented as compound Y+UV blob
I420, ///< I420 color format represented as compound Y+U+V blob
};
/**
* @brief Prints a string representation of InferenceEngine::ColorFormat to a stream
* @param out An output stream to send to
* @param fmt A color format value to print to a stream
* @return A reference to the `out` stream
*/
inline std::ostream& operator<<(std::ostream& out, const ColorFormat& fmt) {
switch (fmt) {
#define PRINT_COLOR_FORMAT(name) \
@ -235,7 +249,6 @@ struct ResponseDesc {
char msg[4096] = {};
};
/**
* @brief Response structure encapsulating information about supported layer
*/
@ -312,13 +325,14 @@ class NotAllocated : public std::logic_error {
class InferNotStarted : public std::logic_error {
using std::logic_error::logic_error;
};
} // namespace InferenceEngine
/** @brief This class represents StatusCode::NETWORK_NOT_READ exception */
class NetworkNotRead : public std::logic_error {
using std::logic_error::logic_error;
};
} // namespace InferenceEngine
#if defined(_WIN32)
#define __PRETTY_FUNCTION__ __FUNCSIG__
#else

View File

@ -49,12 +49,14 @@ public:
explicit CompoundBlob(std::vector<Blob::Ptr>&& blobs);
/**
* @brief Always returns 0
* @brief Always returns `0`
* @return Returns `0`
*/
size_t byteSize() const noexcept override;
/**
* @brief Always returns 0
* @brief Always returns `0`
* @return Returns `0`
*/
size_t element_size() const noexcept override;
@ -65,7 +67,7 @@ public:
/**
* @brief No operation is performed. Compound blob does not allocate/deallocate any data
* @return false
* @return Returns `false`
*/
bool deallocate() noexcept override;

View File

@ -46,7 +46,7 @@ public:
* This method need to be called to find output names for using them later
* when calling InferenceEngine::InferRequest::GetBlob or InferenceEngine::InferRequest::SetBlob
*
* @param out Reference to the ::ConstOutputsDataMap object
* @param out Reference to the InferenceEngine::ConstOutputsDataMap object
* @param resp Optional: pointer to an already allocated object to contain information in case of failure
* @return Status code of the operation: InferenceEngine::OK (0) for success
*/
@ -55,11 +55,11 @@ public:
/**
* @brief Gets the executable network input Data node information.
*
* The received info is stored in the given ::ConstInputsDataMap object.
* The received info is stored in the given InferenceEngine::ConstInputsDataMap object.
* This method need to be called to find out input names for using them later
* when calling InferenceEngine::InferRequest::SetBlob
*
* @param inputs Reference to ::ConstInputsDataMap object.
* @param inputs Reference to InferenceEngine::ConstInputsDataMap object.
* @param resp Optional: pointer to an already allocated object to contain information in case of failure
* @return Status code of the operation: InferenceEngine::OK (0) for success
*/

View File

@ -20,7 +20,7 @@ namespace InferenceEngine {
/**
* @interface IVariableState
* @brief manages data for reset operations
* @brief Manages data for reset operations
*/
class IVariableState : public details::no_copy {
public:
@ -30,8 +30,8 @@ public:
using Ptr = std::shared_ptr<IVariableState>;
/**
* @brief Gets name of current memory state, if length of array is not enough name is truncated by len, null
* terminator is inserted as well. As memory state name variable_id from according ReadValue used.
* @brief Gets name of current variable state, if length of array is not enough name is truncated by len, null
* terminator is inserted as well. As variable state name `variable_id` from according `ReadValue` used.
*
* @param name preallocated buffer for receiving name
* @param len Length of the buffer
@ -41,7 +41,7 @@ public:
virtual StatusCode GetName(char* name, size_t len, ResponseDesc* resp) const noexcept = 0;
/**
* @brief Reset internal memory state for relevant infer request, to a value specified as default for according ReadValue node
* @brief Reset internal variable state for relevant infer request, to a value specified as default for according ReadValue node
*
* @param resp Optional: pointer to an already allocated object to contain information in case of failure
* @return Status code of the operation: InferenceEngine::OK (0) for success*
@ -53,26 +53,37 @@ public:
*
* This method can fail if Blob size does not match the internal state size or precision
*
* @param newState is the data to use as new state
* @param newState The data to use as new state
* @param resp Optional: pointer to an already allocated object to contain information in case of failure
* @return Status code of the operation: InferenceEngine::OK (0) for success
*/
virtual StatusCode SetState(Blob::Ptr newState, ResponseDesc* resp) noexcept = 0;
/**
* @brief Returns the value of the memory state.
* @brief Returns the value of the variable state.
*
* @param lastState
* @param state A reference to a blob containing a variable state
* @param resp Optional: pointer to an already allocated object to contain information in case of failure
* @return Status code of the operation: InferenceEngine::OK (0) for success
* */
*/
INFERENCE_ENGINE_DEPRECATED("Use GetState function instead")
virtual StatusCode GetLastState(Blob::CPtr& state, ResponseDesc* resp) const noexcept {return GetState(state, resp);}
virtual StatusCode GetLastState(Blob::CPtr& state, ResponseDesc* resp) const noexcept {
return GetState(state, resp);
}
/**
* @brief Returns the value of the variable state.
*
* @param state A reference to a blob containing a variable state
* @param resp Optional: pointer to an already allocated object to contain information in case of failure
* @return Status code of the operation: InferenceEngine::OK (0) for success
*/
virtual StatusCode GetState(Blob::CPtr& state, ResponseDesc* resp) const noexcept = 0;
};
/*
/**
* @brief For compatibility reasons.
*/
using IMemoryState = IVariableState;
} // namespace InferenceEngine

View File

@ -125,6 +125,7 @@ public:
/**
* @brief Returns the tensor descriptor
* @return A const reference to a tensor descriptor
*/
const TensorDesc& getTensorDesc() const {
if (!_inputData) {

View File

@ -130,6 +130,11 @@ public:
bool operator!=(const BlockingDesc& rhs) const;
protected:
/**
* @brief Fills tensor descriptor based on blocking dimensions and specific order
* @param blocked_dims A vector representing blocking dimensions
* @param order A vector with specific dims order
*/
void fillDesc(const SizeVector& blocked_dims, const SizeVector& order);
private:
@ -330,6 +335,14 @@ struct ROI {
ROI() = default;
/**
* @brief Creates a ROI objects with given parameters
* @param id ID of a ROI (offset over batch dimension)
* @param posX W upper left coordinate of ROI
* @param posY H upper left coordinate of ROI
* @param sizeX W size of ROI
* @param sizeY H size of ROI
*/
ROI(size_t id, size_t posX, size_t posY, size_t sizeX, size_t sizeY) :
id(id), posX(posX), posY(posY), sizeX(sizeX), sizeY(sizeY) {
}

View File

@ -168,7 +168,7 @@ public:
/**
* @brief Compares stored object with the given one
* @param pointer An pointer to compare with.
* @return true if objects are equal, false otherwise
* @return `true` if objects are equal, `false` otherwise
*/
bool operator==(const T* pointer) const {
// special case with nullptr
@ -177,8 +177,9 @@ public:
/**
* @brief Compares the object with the one stored in the memory.
*
* @return true if objects are equal, false otherwise
* @param pointer A pointer to compare with
* @param lm A compared LockedMemory object
* @return `true` if objects are equal, `false` otherwise
*/
friend bool operator==(const T* pointer, const LockedMemory<T>& lm) {
return lm.operator==(pointer);
@ -266,8 +267,8 @@ public:
/**
* @brief Compares stored object with the given one
*
* @return true if objects are equal, false otherwise
* @param pointer A pointer to compare with
* @return `true` if objects are equal, `false` otherwise
*/
bool operator==(const void* pointer) const {
// special case with nullptr
@ -276,8 +277,9 @@ public:
/**
* @brief Compares the object with the one stored in the memory
*
* @return true if objects are equal, false otherwise
* @param pointer A pointer to compare with
* @param lm A compared LockedMemory object
* @return `true` if objects are equal, `false` otherwise
*/
friend bool operator==(const void* pointer, const LockedMemory<void>& lm) {
return lm.operator==(pointer);
@ -362,8 +364,8 @@ public:
/**
* @brief Compares stored object with the given one
*
* @return true if objects are equal, false otherwise
* @param pointer A pointer to compare with
* @return `true` if objects are equal, `false` otherwise
*/
bool operator==(const T* pointer) const {
// special case with nullptr
@ -372,8 +374,9 @@ public:
/**
* @brief Compares the object with the one stored in the memory
*
* @return true if objects are equal, false otherwise
* @param pointer A pointer to compare with
* @param lm A compared LockedMemory object
* @return `true` if objects are equal, `false` otherwise
*/
friend bool operator==(const T* pointer, const LockedMemory<const T>& lm) {
return lm.operator==(pointer);

View File

@ -58,6 +58,15 @@ inline int parallel_get_env_threads() {
}
#if IE_THREAD == IE_THREAD_TBB
#define PARTITIONING , tbb::static_partitioner()
// The TBB version less than 2018u1 has no static_partitioner argument for
// tbb::parallel_deterministic_reduce. So will fallback to non deterministic version.
#if (TBB_INTERFACE_VERSION >= 10001)
#define _TBB_REDUCE_FUNC tbb::parallel_deterministic_reduce
#else
#define _TBB_REDUCE_FUNC tbb::parallel_reduce
#endif
#else
#define PARTITIONING
#endif
@ -186,7 +195,7 @@ void parallel_sort(I begin, I end, const F& comparator) {
template <typename T0, typename R, typename F>
R parallel_sum(const T0& D0, const R& input, const F& func) {
#if (IE_THREAD == IE_THREAD_TBB || IE_THREAD == IE_THREAD_TBB_AUTO)
return tbb::parallel_deterministic_reduce(
return _TBB_REDUCE_FUNC(
tbb::blocked_range<T0>(0, D0), input,
[&](const tbb::blocked_range<T0>& r, R init) -> R {
R sum = init;
@ -218,7 +227,7 @@ R parallel_sum(const T0& D0, const R& input, const F& func) {
template <typename T0, typename T1, typename R, typename F>
R parallel_sum2d(const T0& D0, const T1& D1, const R& input, const F& func) {
#if (IE_THREAD == IE_THREAD_TBB || IE_THREAD == IE_THREAD_TBB_AUTO)
return tbb::parallel_deterministic_reduce(
return _TBB_REDUCE_FUNC(
tbb::blocked_range2d<T0, T1>(0, D0, 0, D1), input,
[&](const tbb::blocked_range2d<T0, T1>& r, R init) -> R {
R sum = init;
@ -257,7 +266,7 @@ R parallel_sum2d(const T0& D0, const T1& D1, const R& input, const F& func) {
template <typename T0, typename T1, typename T2, typename R, typename F>
R parallel_sum3d(const T0& D0, const T1& D1, const T2& D2, const R& input, const F& func) {
#if (IE_THREAD == IE_THREAD_TBB || IE_THREAD == IE_THREAD_TBB_AUTO)
return tbb::parallel_deterministic_reduce(
return _TBB_REDUCE_FUNC(
tbb::blocked_range3d<T0, T1, T2>(0, D0, 0, D1, 0, D2), input,
[&](const tbb::blocked_range3d<T0, T1, T2>& r, R init) -> R {
R sum = init;

View File

@ -60,7 +60,10 @@ public:
/** @brief Default constructor */
Precision() = default;
/** @brief Constructor with specified precision */
/**
* @brief Constructor with specified precision
* @param value A value of ePrecision to create an object from
*/
Precision(const Precision::ePrecision value) { // NOLINT
precisionInfo = getPrecisionInfo(value);
}
@ -69,7 +72,7 @@ public:
* @brief Custom precision constructor
*
* @param bitsSize size of elements
* @param name optional name string, used in serialisation
* @param name optional: name string, used in serialisation
*/
explicit Precision(size_t bitsSize, const char* name = nullptr) {
if (bitsSize == 0) {
@ -131,39 +134,64 @@ public:
}
}
/** @brief Equality operator with Precision object */
/**
* @brief Equality operator with Precision object
* @param p A value of Precision to compare with
* @return `true` if values represent the same precisions, `false` otherwise
*/
bool operator==(const Precision& p) const noexcept {
return precisionInfo.value == p && precisionInfo.bitsSize == p.precisionInfo.bitsSize &&
areSameStrings(precisionInfo.name, p.precisionInfo.name);
}
/** @brief Equality operator with ePrecision enum value */
/**
* @brief Equality operator with ePrecision enum value
* @param p A value of ePrecision to compare with
* @return `true` if values represent the same precisions, `false` otherwise
*/
bool operator==(const ePrecision p) const noexcept {
return precisionInfo.value == p;
}
/** @brief Inequality operator with ePrecision enum value */
/**
* @brief Inequality operator with ePrecision enum value
* @param p A value of ePrecision to compare with
* @return `true` if values represent different precisions, `false` otherwise
*/
bool operator!=(const ePrecision p) const noexcept {
return precisionInfo.value != p;
}
/** @brief Assignment operator with ePrecision enum value */
/**
* @brief Assignment operator with ePrecision enum value
* @param p A value of ePrecision enumeration
* @return A Precision instance
*/
Precision& operator=(const ePrecision p) noexcept {
precisionInfo = getPrecisionInfo(p);
return *this;
}
/** @brief Cast operator to a bool */
/**
* @brief Cast operator to a bool
* @return `true` if precision is specified, `false` otherwise
*/
explicit operator bool() const noexcept {
return precisionInfo.value != UNSPECIFIED;
}
/** @brief Logical negation operator */
/**
* @brief Logical negation operator
* @return `true` if precision is NOT specified, `false` otherwise
*/
bool operator!() const noexcept {
return precisionInfo.value == UNSPECIFIED;
}
/** @brief Cast operator to a ePrecision */
/**
* @brief Cast operator to a ePrecision
* @return A casted value of Precision::ePrecision enumeration
*/
operator Precision::ePrecision() const noexcept {
return precisionInfo.value;
}
@ -176,12 +204,19 @@ public:
return precisionInfo.value;
}
/** @brief Getter of precision name */
/**
* @brief Getter of precision name
* @return A string representing precision name
*/
const char* name() const noexcept {
return precisionInfo.name;
}
/** @brief Creates from string with precision name */
/**
* @brief Creates Precision from string with precision name
* @param str A string representing precision
* @return Precision created from string representation
*/
static Precision FromStr(const std::string& str) {
static std::unordered_map<std::string, ePrecision> names = {
#define PRECISION_NAME(s) {#s, s}
@ -256,7 +291,9 @@ protected:
}
/**
* @brief Return PrecisionInfo
* @brief Creates PrecisionInfo based on ePrecision
* @param v A value of ePrecision emuneration
* @return Precision info object
*/
static PrecisionInfo getPrecisionInfo(ePrecision v) {
#define CASE(x) \

View File

@ -29,6 +29,8 @@ namespace InferenceEngine {
/**
* @deprecated Use OS-native conversion utilities
* @brief Conversion from possibly-wide character string to a single-byte chain.
* @param str A possibly-wide character string
* @return A single-byte character string
*/
INFERENCE_ENGINE_DEPRECATED("Use OS-native conversion utilities")
inline std::string fileNameToString(const file_name_t& str) {
@ -47,6 +49,8 @@ inline std::string fileNameToString(const file_name_t& str) {
/**
* @deprecated Use OS-native conversion utilities
* @brief Conversion from single-byte character string to a possibly-wide one
* @param str A single-byte character string
* @return A possibly-wide character string
*/
INFERENCE_ENGINE_DEPRECATED("Use OS-native conversion utilities")
inline file_name_t stringToFileName(const std::string& str) {

View File

@ -23,8 +23,8 @@ struct Version {
* @brief An API version reflects the set of supported features
*/
struct {
int major;
int minor;
int major; //!< A major version
int minor; //!< A minor version
} apiVersion;
/**
* @brief A null terminated string with build number

View File

@ -137,6 +137,10 @@ else()
find_package(InferenceEngine 2.1 REQUIRED)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/utils")
add_subdirectory(common/utils)
endif()
# format reader must be added after find_package(InferenceEngine) to get
# exactly the same OpenCV_DIR path which was used for the InferenceEngine build
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/common/format_reader")

View File

@ -8,5 +8,6 @@ file (GLOB HDR ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
ie_add_sample(NAME benchmark_app
SOURCES ${SRC}
HEADERS ${HDR}
DEPENDENCIES format_reader
DEPENDENCIES format_reader ie_samples_utils
OPENCV_DEPENDENCIES imgcodecs)

Some files were not shown because too many files have changed in this diff Show More