Skip to content

Commit

Permalink
Merge branch 'master' into update_evaluates
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Treskin committed Oct 12, 2020
2 parents da4b5e3 + 5ce622f commit 7f66509
Show file tree
Hide file tree
Showing 351 changed files with 6,185 additions and 1,220 deletions.
3 changes: 3 additions & 0 deletions .ci/openvino-onnx/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ pipeline {
}
}
stage("Run tests") {
options {
timeout(time: 15, unit: 'MINUTES')
}
steps{
runTests()
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Thank you!
## Support
Please report questions, issues and suggestions using:

* The `openvino` [tag on StackOverflow]\*
* The [`openvino`](https://stackoverflow.com/questions/tagged/openvino) tag on StackOverflow\*
* [GitHub* Issues](https://github.com/openvinotoolkit/openvino/issues)
* [Forum](https://software.intel.com/en-us/forums/computer-vision)

Expand Down
2 changes: 1 addition & 1 deletion cmake/os_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ macro(ie_enable_lto)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
endif()

# modify linker and ar
# modify runlib and ar tools
if(LINUX)
set(CMAKE_AR "gcc-ar")
set(CMAKE_RANLIB "gcc-ranlib")
Expand Down
2 changes: 1 addition & 1 deletion cmake/shellcheck/shellcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function(ie_shellcheck_process)
-D IE_SHELL_SCRIPT=${script}
-D IE_SHELLCHECK_OUTPUT=${output_file}
-P ${IE_SHELLCHECK_SCRIPT}
DEPENDS ${script}
DEPENDS ${script} ${IE_SHELLCHECK_SCRIPT}
COMMENT "Check script ${script_name}"
VERBATIM)
list(APPEND outputs ${output_file})
Expand Down
2 changes: 1 addition & 1 deletion cmake/shellcheck/shellcheck_process.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(NOT DEFINED IE_SHELLCHECK_OUTPUT)
message(FATAL_ERROR "IE_SHELLCHECK_OUTPUT is not defined")
endif()

set(rules "SC1091,SC2236,SC2164,SC2086,SC2162,SC1090")
set(rules "SC1091,SC2164,SC2162,SC1090")
execute_process(COMMAND ${IE_SHELLCHECK_PROGRAM} --exclude=${rules} ${IE_SHELL_SCRIPT}
OUTPUT_VARIABLE error_message
RESULT_VARIABLE exit_code
Expand Down
7 changes: 5 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

if(NOT ENABLE_DOCKER)
add_subdirectory(examples)
add_subdirectory(snippets)

# Detect nGraph
find_package(ngraph QUIET)
Expand All @@ -17,10 +17,13 @@ if(NOT ENABLE_DOCKER)
set(InferenceEngine_DIR ${CMAKE_BINARY_DIR})
endif()

if (NGRAPH_ONNX_IMPORT_ENABLE)
add_subdirectory(onnx_custom_op)
endif()
add_subdirectory(template_extension)

set(all_docs_targets
ie_docs_examples
ie_docs_snippets
template_extension
templatePlugin TemplateBehaviorTests TemplateFunctionalTests)
foreach(target_name IN LISTS all_docs_targets)
Expand Down
2 changes: 1 addition & 1 deletion docs/IE_DG/Extensibility_DG/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Inference Engine build infrastructure provides the Inference Engine Package for

To build an extension library, use the following CMake script:

@snippet CMakeLists.txt cmake:extension
@snippet template_extension/CMakeLists.txt cmake:extension

This CMake script finds the Inference Engine and nGraph using the `find_package` CMake command.

Expand Down
57 changes: 57 additions & 0 deletions docs/IE_DG/Extensibility_DG/Custom_ONNX_Ops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Custom ONNX operators {#openvino_docs_IE_DG_Extensibility_DG_Custom_ONNX_Ops}

ONNX importer provides mechanism to register custom ONNX operators based on predefined or user-defined nGraph operations.
The function responsible for registering a new operator is called `ngraph::onnx_import::register_operator` and is defined in `onnx_import/onnx_utils.hpp`.

## Registering custom ONNX operator based on predefined nGraph operations

The steps below explain how to register a custom ONNX operator, for example, CustomRelu, in a domain called com.example.
CustomRelu is defined as follows:
```
x >= 0 => f(x) = x * alpha
x < 0 => f(x) = x * beta
```
where alpha, beta are float constants.

1. Include headers:
@snippet onnx_custom_op/main.cpp onnx_custom_op:headers

2. Register the CustomRelu operator in the ONNX importer:
@snippet onnx_custom_op/main.cpp onnx_custom_op:register_operator
The `register_operator` function takes four arguments: op_type, opset version, domain, and a function object.
The function object is a user-defined function that takes `ngraph::onnx_import::Node` as an input and based on that, returns a graph with nGraph operations.
The `ngraph::onnx_import::Node` class represents a node in ONNX model. It provides functions to fetch input node(s) (`get_ng_inputs`), fetch attribute value (`get_attribute_value`) and many more (please refer to `onnx_import/core/node.hpp` for full class declaration).
New operator registration must happen before the ONNX model is read, for example, if an ONNX model uses the 'CustomRelu' operator, `register_operator("CustomRelu", ...)` must be called before InferenceEngine::Core::ReadNetwork.
Re-registering ONNX operators within the same process is supported. During registration of the existing operator, a warning is printed.

The example below demonstrates an examplary model that requires previously created 'CustomRelu' operator:
@snippet onnx_custom_op/main.cpp onnx_custom_op:model


For a reference on how to create a graph with nGraph operations, visit [nGraph tutorial](../nGraphTutorial.md).
For a complete list of predefined nGraph operators, visit [available operations sets](../../ops/opset.md).

If operator is no longer needed, it can be unregistered by calling `unregister_operator`. The function takes three arguments `op_type`, `version`, and `domain`.
@snippet onnx_custom_op/main.cpp onnx_custom_op:unregister_operator

## Registering custom ONNX operator based on custom nGraph operations

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

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
Note that it is mandatory to unregister custom ONNX operator if it is defined in dynamic shared library.

## Requirements for building with CMake

Program that uses the `register_operator` functionality, requires (in addition to Inference Engine) `ngraph` and `onnx_importer` libraries.
The `onnx_importer` is a component of `ngraph` package , so `find_package(ngraph REQUIRED COMPONENTS onnx_importer)` is sufficient to find both.
The `ngraph` package exposes two variables (`${NGRAPH_LIBRARIES}` and `${ONNX_IMPORTER_LIBRARIES}`), which reference `ngraph` and `onnx_importer` libraries.
Those variables need to be passed to the `target_link_libraries` command in the CMakeLists.txt file.

See below CMakeLists.txt for reference:
@snippet onnx_custom_op/CMakeLists.txt cmake:onnx_custom_op
1 change: 1 addition & 0 deletions docs/IE_DG/Extensibility_DG/Extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Implement the InferenceEngine::IExtension::getOpSets method if the extension co
Read the [guide about custom operations](AddingNGraphOps.md) for more information.

To understand how integrate execution kernels to the extension library, read the [guide about development of custom CPU kernels](CPU_Kernel.md).
To understand how to register custom ONNX operator to the extension library, read the [guide about custom ONNX operators](Custom_ONNX_Ops.md).
4 changes: 2 additions & 2 deletions docs/IE_PLUGIN_DG/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -868,13 +868,13 @@ EXCLUDE_SYMBOLS =
# command).

EXAMPLE_PATH = ../template_plugin/src \
../template_plugin/include \
../template_plugin/include \
../template_plugin/src/CMakeLists.txt \
../template_plugin/tests/functional/CMakeLists.txt \
../template_plugin/tests/functional/transformations \
../template_plugin/tests/functional/shared_tests_instances/ \
../../inference-engine/tests/functional/plugin/shared/include \
../examples
../snippets

# 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
Expand Down
6 changes: 5 additions & 1 deletion docs/MO_DG/prepare_model/Supported_Frameworks_Layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ Standard Kaldi\* Layers:
| Crop | No |
| elementwiseproductcomponent | No |
| fixedaffinecomponent | No |
| fixedbiascomponent | No |
| fixedscalecomponent | No |
| generaldropoutcomponent| Not needed for inference |
| linearcomponent | No |
| logsoftmaxcomponent | No |
| lstmnonlinearitycomponent | No |
Expand All @@ -279,12 +282,13 @@ Standard Kaldi\* Layers:
| rectifiedlinearcomponent | No |
| rescale | No |
| sigmoid | No |
| slice | No |
| softmax | No |
| softmaxComponent | No |
| softsign | No |
| specaugmenttimemaskcomponent | Not needed for inference |
| splicecomponent | No |
| tanhcomponent | No |
| tdnncomponent | No |


## ONNX\* Supported Operators
Expand Down
7 changes: 5 additions & 2 deletions docs/doxygen/ie_docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
<tab type="user" title="LogicalNot-1" url="@ref openvino_docs_ops_logical_LogicalNot_1"/>
<tab type="user" title="LogicalOr-1" url="@ref openvino_docs_ops_logical_LogicalOr_1"/>
<tab type="user" title="LogicalXor-1" url="@ref openvino_docs_ops_logical_LogicalXor_1"/>
<tab type="user" title="LogSoftmax-5" url="@ref openvino_docs_ops_activation_LogSoftmax_5"/>
<tab type="user" title="MVN-1" url="@ref openvino_docs_ops_normalization_MVN_1"/>
<tab type="user" title="MatMul-1" url="@ref openvino_docs_ops_matrix_MatMul_1"/>
<tab type="user" title="MaxPool-1" url="@ref openvino_docs_ops_pooling_MaxPool_1"/>
Expand All @@ -186,6 +187,7 @@
<tab type="user" title="NonMaxSuppression-1" url="@ref openvino_docs_ops_sort_NonMaxSuppression_1"/>
<tab type="user" title="NonMaxSuppression-3" url="@ref openvino_docs_ops_sort_NonMaxSuppression_3"/>
<tab type="user" title="NonMaxSuppression-4" url="@ref openvino_docs_ops_sort_NonMaxSuppression_4"/>
<tab type="user" title="NonMaxSuppression-5" url="@ref openvino_docs_ops_sort_NonMaxSuppression_5"/>
<tab type="user" title="NonZero-3" url="@ref openvino_docs_ops_condition_NonZero_3"/>
<tab type="user" title="NormalizeL2-1" url="@ref openvino_docs_ops_normalization_NormalizeL2_1"/>
<tab type="user" title="NotEqual-1" url="@ref openvino_docs_ops_comparison_NotEqual_1"/>
Expand Down Expand Up @@ -270,6 +272,7 @@
<tab type="user" title="GPU Kernels Extensibility" url="@ref openvino_docs_IE_DG_Extensibility_DG_GPU_Kernel"/>
<tab type="user" title="VPU Kernels Extensibility" url="@ref openvino_docs_IE_DG_Extensibility_DG_VPU_Kernel"/>
<tab type="user" title="Build Extension Library Using CMake" url="@ref openvino_docs_IE_DG_Extensibility_DG_Building"/>
<tab type="user" title="Custom ONNX operators" url="@ref openvino_docs_IE_DG_Extensibility_DG_Custom_ONNX_Ops"/>
</tab>
<tab type="user" title="Integrate the Inference Engine with Your Application" url="@ref openvino_docs_IE_DG_Integrate_with_customer_application_new_API"/>
<tab type="user" title="[DEPRECATED] Migration from Inference Engine Plugin API to Core API" url="@ref openvino_docs_IE_DG_Migration_CoreAPI"/>
Expand Down Expand Up @@ -366,7 +369,7 @@
<tab type="user" title="Build Application with Deployment Package" url="@ref workbench_docs_Workbench_DG_Deployment_Package"/>
<tab type="user" title="Deploy and Integrate Performance Criteria into Application" url="@ref workbench_docs_Workbench_DG_Deploy_and_Integrate_Performance_Criteria_into_Application"/>
<tab type="user" title="Persist Database State" url="@ref workbench_docs_Workbench_DG_Persist_Database"/>
<tab type="user" title="Work with Docker Container" url="@ref workbench_docs_Workbench_DG_Docker_Container"/>
<tab type="user" title="Work with Docker Container" url="@ref workbench_docs_Workbench_DG_Docker_Container"/>
</tab>
<tab type="usergroup" title="DL Workbench Security Guide" url="@ref workbench_docs_Workbench_DG_Configure_TLS">
<tab type="user" title="Configure Transport Layer Security (TLS)" url="@ref workbench_docs_Workbench_DG_Configure_TLS"/>
Expand Down Expand Up @@ -617,7 +620,7 @@
<tab type="user" title="driver-action-recognition-adas-0002" url="@ref omz_models_intel_driver_action_recognition_adas_0002_description_driver_action_recognition_adas_0002"/>
<tab type="user" title="action-recognition-0001" url="@ref omz_models_intel_action_recognition_0001_description_action_recognition_0001"/>
<tab type="user" title="asl-recognition-0004" url="@ref omz_models_intel_asl_recognition_0004_description_asl_recognition_0004"/>
<tab type="user" title="weld-porosity-detection-0001" url="@ref omz_models_intel_weld_porosity_detection_0001_description_weld_porosity_detection_0001"/>
<tab type="user" title="weld-porosity-detection-0001" url="@ref omz_models_intel_weld_porosity_detection_0001_description_weld_porosity_detection_0001"/>
</tab>
<tab type="usergroup" title="Image Retrieval" url="">
<tab type="user" title="image-retrieval-0001" url="@ref omz_models_intel_image_retrieval_0001_description_image_retrieval_0001"/>
Expand Down
13 changes: 0 additions & 13 deletions docs/examples/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 7f66509

Please sign in to comment.