Skip to content

Commit

Permalink
[Python API] Move samples and docs to the new directory (openvinotool…
Browse files Browse the repository at this point in the history
…kit#7851)

* [Python API] Move samples and docs to the new directory

* move samples to the new directory

* try to fix build and pychecks

* fix links

* fix pychecks

* fix cmake

* fix cpack installation

* Update inference-engine/ie_bridges/python/CMakeLists.txt

Co-authored-by: Sergey Lyubimtsev <[email protected]>

Co-authored-by: Sergey Lyubimtsev <[email protected]>
  • Loading branch information
akuporos and slyubimt authored Oct 14, 2021
1 parent eb838d5 commit 799be77
Show file tree
Hide file tree
Showing 39 changed files with 126 additions and 91 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/py_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
push:
paths:
- 'inference-engine/ie_bridges/python/**'
- 'samples/python/**'
pull_request:
paths:
- 'inference-engine/ie_bridges/python/**'
- 'samples/python/**'
jobs:
linters:
runs-on: ubuntu-18.04
Expand All @@ -23,14 +25,14 @@ jobs:
- name: Install dependencies
run: python -m pip install -r inference-engine/ie_bridges/python/requirements_dev.txt
- name: Run Flake on samples
run: python -m flake8 ./ --config=../setup.cfg
working-directory: inference-engine/ie_bridges/python/sample
run: python -m flake8 ./ --config=setup.cfg
working-directory: samples/python
- name: Create code style diff for samples
if: failure()
run: |
python -m black -l 160 -S ./
git diff > samples_diff.diff
working-directory: inference-engine/ie_bridges/python/sample
working-directory: samples/python
- uses: actions/upload-artifact@v2
if: failure()
with:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ add_subdirectory(inference-engine)
openvino_developer_export_targets(COMPONENT ngraph TARGETS ngraph_backend interpreter_backend)
include(cmake/extra_modules.cmake)

add_subdirectory(samples)
add_subdirectory(model-optimizer)
add_subdirectory(docs)
add_subdirectory(tools)
Expand Down
8 changes: 8 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ function(build_docs)
"${OpenVINO_SOURCE_DIR}/inference-engine/*.png"
"${OpenVINO_SOURCE_DIR}/inference-engine/*.gif"
"${OpenVINO_SOURCE_DIR}/inference-engine/*.jpg"
"${OpenVINO_SOURCE_DIR}/runtime/*.md"
"${OpenVINO_SOURCE_DIR}/runtime/*.png"
"${OpenVINO_SOURCE_DIR}/runtime/*.gif"
"${OpenVINO_SOURCE_DIR}/runtime/*.jpg"
"${OpenVINO_SOURCE_DIR}/samples/*.md"
"${OpenVINO_SOURCE_DIR}/samples/*.png"
"${OpenVINO_SOURCE_DIR}/samples/*.gif"
"${OpenVINO_SOURCE_DIR}/samples/*.jpg"
"${OpenVINO_SOURCE_DIR}/tools/*.md"
"${OpenVINO_SOURCE_DIR}/tools/*.png"
"${OpenVINO_SOURCE_DIR}/tools/*.gif"
Expand Down
2 changes: 1 addition & 1 deletion docs/IE_DG/PythonPackage_Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The OpenVINO™ Python\* package available in the `<INSTALL_DIR>/python/python3.

The OpenVINO™ Python\* package includes the following sub-packages:

- [openvino.inference_engine](../../inference-engine/ie_bridges/python/docs/api_overview.md) - Python\* wrapper on OpenVINO™ Inference Engine.
- [openvino.inference_engine](../../runtime/bindings/python/docs/api_overview.md) - Python\* wrapper on OpenVINO™ Inference Engine.
- `openvino.tools.accuracy_checker` - Measure accuracy.
- `openvino.tools.benchmark` - Measure latency and throughput.

Expand Down
16 changes: 8 additions & 8 deletions docs/IE_DG/Samples_Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ Inference Engine sample applications include the following:

- **Speech Sample** - Acoustic model inference based on Kaldi neural networks and speech feature vectors.
- [Automatic Speech Recognition C++ Sample](../../inference-engine/samples/speech_sample/README.md)
- [Automatic Speech Recognition Python Sample](../../inference-engine/ie_bridges/python/sample/speech_sample/README.md)
- [Automatic Speech Recognition Python Sample](../../samples/python/speech_sample/README.md)
- **Benchmark Application** – Estimates deep learning inference performance on supported devices for synchronous and asynchronous modes.
- [Benchmark C++ Tool](../../inference-engine/samples/benchmark_app/README.md)
- [Benchmark Python Tool](../../tools/benchmark_tool/README.md)
- **Hello Classification Sample** – Inference of image classification networks like AlexNet and GoogLeNet using Synchronous Inference Request API. Input of any size and layout can be set to an infer request which will be pre-processed automatically during inference (the sample supports only images as inputs and supports Unicode paths).
- [Hello Classification C++ Sample](../../inference-engine/samples/hello_classification/README.md)
- [Hello Classification C Sample](../../inference-engine/ie_bridges/c/samples/hello_classification/README.md)
- [Hello Classification Python Sample](../../inference-engine/ie_bridges/python/sample/hello_classification/README.md)
- [Hello Classification Python Sample](../../samples/python/hello_classification/README.md)
- **Hello NV12 Input Classification Sample** – Input of any size and layout can be provided to an infer request. The sample transforms the input to the NV12 color format and pre-process it automatically during inference. The sample supports only images as inputs.
- [Hello NV12 Input Classification C++ Sample](../../inference-engine/samples/hello_nv12_input_classification/README.md)
- [Hello NV12 Input Classification C Sample](../../inference-engine/ie_bridges/c/samples/hello_nv12_input_classification/README.md)
- **Hello Query Device Sample** – Query of available Inference Engine devices and their metrics, configuration values.
- [Hello Query Device C++ Sample](../../inference-engine/samples/hello_query_device/README.md)
- [Hello Query Device Python* Sample](../../inference-engine/ie_bridges/python/sample/hello_query_device/README.md)
- [Hello Query Device Python* Sample](../../samples/python/hello_query_device/README.md)
- **Hello Reshape SSD Sample** – Inference of SSD networks resized by ShapeInfer API according to an input size.
- [Hello Reshape SSD C++ Sample**](../../inference-engine/samples/hello_reshape_ssd/README.md)
- [Hello Reshape SSD Python Sample**](../../inference-engine/ie_bridges/python/sample/hello_reshape_ssd/README.md)
- [Hello Reshape SSD Python Sample**](../../samples/python/hello_reshape_ssd/README.md)
- **Image Classification Sample Async** – Inference of image classification networks like AlexNet and GoogLeNet using Asynchronous Inference Request API (the sample supports only images as inputs).
- [Image Classification Async C++ Sample](../../inference-engine/samples/classification_sample_async/README.md)
- [Image Classification Async Python* Sample](../../inference-engine/ie_bridges/python/sample/classification_sample_async/README.md)
- [Image Classification Async Python* Sample](../../samples/python/classification_sample_async/README.md)
- **Style Transfer Sample** – Style Transfer sample (the sample supports only images as inputs).
- [Style Transfer C++ Sample](../../inference-engine/samples/style_transfer_sample/README.md)
- [Style Transfer Python* Sample](../../inference-engine/ie_bridges/python/sample/style_transfer_sample/README.md)
- [Style Transfer Python* Sample](../../samples/python/style_transfer_sample/README.md)
- **nGraph Function Creation Sample** – Construction of the LeNet network using the nGraph function creation sample.
- [nGraph Function Creation C++ Sample](../../inference-engine/samples/ngraph_function_creation_sample/README.md)
- [nGraph Function Creation Python Sample](../../inference-engine/ie_bridges/python/sample/ngraph_function_creation_sample/README.md)
- [nGraph Function Creation Python Sample](../../samples/python/ngraph_function_creation_sample/README.md)
- **Object Detection for SSD Sample** – Inference of object detection networks based on the SSD, this sample is simplified version that supports only images as inputs.
- [Object Detection SSD C++ Sample](../../inference-engine/samples/object_detection_sample_ssd/README.md)
- [Object Detection SSD C Sample](../../inference-engine/ie_bridges/c/samples/object_detection_sample_ssd/README.md)
- [Object Detection SSD Python* Sample](../../inference-engine/ie_bridges/python/sample/object_detection_sample_ssd/README.md)
- [Object Detection SSD Python* Sample](../../samples/python/object_detection_sample_ssd/README.md)

> **NOTE**: All C++ samples support input paths containing only ASCII characters, except the Hello Classification Sample, that supports Unicode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,4 @@ exec_net = ie.load_network(network=net, device_name="CPU")
result_ie = exec_net.infer(input_data)
```

For more information about Python API, refer to [Inference Engine Python API Overview](../../../../../inference-engine/ie_bridges/python/docs/api_overview.md).
For more information about Python API, refer to [Inference Engine Python API Overview](../../../../../runtime/bindings/python/docs/api_overview.md).
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Hello Classification C sample application demonstrates how to use the following
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
| Validated images | The sample uses OpenCV\* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (\*.bmp, \*.png)
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [C++](../../../../samples/hello_classification/README.md), [Python](../../../python/sample/hello_classification/README.md) |
| Other language realization | [C++](../../../../samples/hello_classification/README.md), [Python](../../../../../samples/python/hello_classification/README.md) |

## How It Works

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Basic Inference Engine API is covered by [Hello Classification C sample](../hell
| Model Format | Inference Engine Intermediate Representation (.xml + .bin), ONNX (.onnx)
| Validated images | The sample uses OpenCV* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (.bmp, .png, .jpg)
| Supported devices | [All](../../../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [C++](../../../../samples/object_detection_sample_ssd/README.md), [Python](../../../python/sample/object_detection_sample_ssd/README.md) |
| Other language realization | [C++](../../../../samples/object_detection_sample_ssd/README.md), [Python](../../../../../samples/python/object_detection_sample_ssd/README.md) |

## How It Works

Expand Down
11 changes: 2 additions & 9 deletions inference-engine/ie_bridges/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ install(PROGRAMS src/openvino/__init__.py
DESTINATION ${PYTHON_BRIDGE_CPACK_PATH}/${PYTHON_VERSION}/openvino
COMPONENT ${PYTHON_COMPONENT})

# install Python samples
# package Python samples

ie_cpack_add_component(python_samples)

install(DIRECTORY sample/
DESTINATION samples/python
USE_SOURCE_PERMISSIONS
COMPONENT python_samples)

ie_cpack(${PYTHON_COMPONENT} python_samples)
ie_cpack(${PYTHON_COMPONENT})
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Basic Inference Engine API is covered by [Hello Classification C++ sample](../he
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
| Validated images | The sample uses OpenCV\* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (\*.bmp, \*.png), single-channel `ubyte` images.
| Supported devices | [All](../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [Python](../../ie_bridges/python/sample/classification_sample_async/README.md) |
| Other language realization | [Python](../../../samples/python/classification_sample_async/README.md) |

## How It Works

Expand Down
2 changes: 1 addition & 1 deletion inference-engine/samples/hello_classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Hello Classification C++ sample application demonstrates how to use the followin
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
| Validated images | The sample uses OpenCV\* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (\*.bmp, \*.png)
| Supported devices | [All](../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [C](../../ie_bridges/c/samples/hello_classification/README.md), [Python](../../ie_bridges/python/sample/hello_classification/README.md) |
| Other language realization | [C](../../ie_bridges/c/samples/hello_classification/README.md), [Python](../../../samples/python/hello_classification/README.md) |

## How It Works

Expand Down
2 changes: 1 addition & 1 deletion inference-engine/samples/hello_query_device/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Basic Inference Engine API is covered by [Hello Classification C++ sample](../he
| Options | Values |
|:--- |:---
| Supported devices | [All](../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [Python](../../ie_bridges/python/sample/hello_query_device/README.md) |
| Other language realization | [Python](../../../samples/python/hello_query_device/README.md) |

## How It Works

Expand Down
2 changes: 1 addition & 1 deletion inference-engine/samples/hello_reshape_ssd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Basic Inference Engine API is covered by [Hello Classification C++ sample](../he
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
| Validated images | The sample uses OpenCV\* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (\*.bmp, \*.png)
| Supported devices | [All](../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [C](../../ie_bridges/c/samples/object_detection_sample_ssd/README.md), [Python](../../ie_bridges/python/sample/hello_reshape_ssd/README.md) |
| Other language realization | [C](../../ie_bridges/c/samples/object_detection_sample_ssd/README.md), [Python](../../../samples/python/hello_reshape_ssd/README.md) |

## How It Works

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Basic Inference Engine API is covered by [Hello Classification C++ sample](../he
| Model Format | Network weights file (\*.bin)
| Validated images | single-channel `MNIST ubyte` images
| Supported devices | [All](../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [Python](../../ie_bridges/python/sample/ngraph_function_creation_sample/README.md) |
| Other language realization | [Python](../../../samples/python/ngraph_function_creation_sample/README.md) |

## How It Works

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Basic Inference Engine API is covered by [Hello Classification C++ sample](../he
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
| Validated images | The sample uses OpenCV\* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (\*.bmp, \*.png)
| Supported devices | [All](../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [C](../../ie_bridges/c/samples/object_detection_sample_ssd/README.md), [Python](../../ie_bridges/python/sample/object_detection_sample_ssd/README.md) |
| Other language realization | [C](../../ie_bridges/c/samples/object_detection_sample_ssd/README.md), [Python](../../../samples/python/object_detection_sample_ssd/README.md) |

## How It Works

Expand Down
2 changes: 1 addition & 1 deletion inference-engine/samples/style_transfer_sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Basic Inference Engine API is covered by [Hello Classification C++ sample](../he
| Model Format | Inference Engine Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx)
| Validated images | The sample uses OpenCV\* to [read input image](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56) (\*.bmp, \*.png)
| Supported devices | [All](../../../docs/IE_DG/supported_plugins/Supported_Devices.md) |
| Other language realization | [Python](../../ie_bridges/python/sample/style_transfer_sample/README.md) |
| Other language realization | [Python](../../../samples/python/style_transfer_sample/README.md) |

## How It Works

Expand Down
12 changes: 12 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

# install Python samples

ie_cpack_add_component(python_samples)

install(DIRECTORY python/
DESTINATION samples/python
USE_SOURCE_PERMISSIONS
COMPONENT python_samples)
Loading

0 comments on commit 799be77

Please sign in to comment.