Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/snippets/mha
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova committed Jan 11, 2023
2 parents 7cd17ff + 4feaeaa commit dc2f206
Show file tree
Hide file tree
Showing 257 changed files with 6,785 additions and 5,315 deletions.
44 changes: 15 additions & 29 deletions .github/workflows/mo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: MO
on:
push:
paths:
- 'openvino/tools/mo/**'
- '.github/workflows/mo.py'
- 'tools/mo/**'
- '.github/workflows/mo.yml'
branches:
- 'master'
- 'releases/**'
pull_request:
paths:
- 'openvino/tools/mo/**'
- '.github/workflows/mo.py'
- 'tools/mo/**'
- '.github/workflows/mo.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -24,48 +24,34 @@ jobs:
with:
submodules: recursive

- name: Setup Python ${{ matrix.python-version }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.10'

- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('openvino/tools/mo/requirements*.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('tools/mo/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
# tensorflow 1.15 causes modules import
# errors, most likely due to https://github.com/PyCQA/pylint/issues/2603
# for tensorflow.core.framework and tensorflow.contrib
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
# For UT
pip install unittest-xml-reporting==3.0.2
# MO requirements
pip install -r requirements.txt
pip install -r requirements_mxnet.txt
pip install -r requirements_caffe.txt
pip install -r requirements_kaldi.txt
pip install -r requirements_onnx.txt
pip install -r requirements_tf2.txt
pip install -r requirements_dev.txt
# requrements for CMake
sudo apt update
sudo apt --assume-yes install libusb-1.0-0-dev
working-directory: openvino/tools/mo
working-directory: tools/mo

- name: Pylint
run: pylint -d C,R,W openvino/tools/mo/ openvino/tools/mo/mo.py
working-directory: openvino/tools/mo

- name: CMake configure
run: cmake -B build

- name: UT
run: |
export PYTHONPATH=$PYTHONPATH:`pwd`
export MO_ROOT=`pwd`
env
mkdir ../mo-ut-logs
python3 -m xmlrunner discover -p *_test.py --output=../mo-ut-logs
working-directory: openvino/tools/mo
run: pylint -d C,R,W openvino/tools/mo
working-directory: tools/mo
10 changes: 5 additions & 5 deletions docs/nbdoc/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

repo_name = "openvino_notebooks"

artifacts_link = "http://repository.toolbox.iotg.sclab.intel.com/projects/ov-notebook/0.1.0-latest/20230104220806/dist/rst_files/"
artifacts_link = "http://repository.toolbox.iotg.sclab.intel.com/projects/ov-notebook/0.1.0-latest/20230109220810/dist/rst_files/"

blacklisted_extensions = ['.xml', '.bin']

Expand All @@ -18,8 +18,8 @@
# Templates

binder_template = """
This tutorial is also available as a Jupyter notebook that can be cloned directly from GitHub.
See the |installation_link| for instructions to run this tutorial locally on Windows, Linux or macOS.
This tutorial is also available as a Jupyter notebook that can be cloned directly from GitHub.
See the |installation_link| for instructions to run this tutorial locally on Windows, Linux or macOS.
To run without installing anything, click the launch binder button.
|binder_link| |github_link|
Expand All @@ -28,7 +28,7 @@
<a href="https://github.com/{{ owner }}/{{ repo }}#-installation-guide" target="_blank">installation guide</a>
.. |binder_link| raw:: html
.. |binder_link| raw:: html
<a href="https://mybinder.org/v2/gh/{{ owner }}/{{ repo }}/HEAD?filepath={{ folder }}%2F{{ notebook }}%2F{{ notebook }}.ipynb" target="_blank"><img src="https://mybinder.org/badge_logo.svg" alt="Binder"></a>
Expand All @@ -39,7 +39,7 @@
\n
"""
no_binder_template = """
This tutorial is also available as a Jupyter notebook that can be cloned directly from GitHub.
This tutorial is also available as a Jupyter notebook that can be cloned directly from GitHub.
See the |installation_link| for instructions to run this tutorial locally on Windows, Linux or macOS.
|github_link|
Expand Down
38 changes: 21 additions & 17 deletions docs/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
.. _notebook tutorials:

.. meta::
:description: A collection of Python tutorials run on Jupyter notebooks. The
tutorials explain how to use OpenVINO™ toolkit for optimized
:description: A collection of Python tutorials run on Jupyter notebooks. The
tutorials explain how to use OpenVINO™ toolkit for optimized
deep learning inference.
:keywords: OpenVINO™ toolkit, Jupyter, Jupyter notebooks, tutorials, Python
API, Python, deep learning, inference, model inference, infer a
model, Binder, object detection, quantization, image
classification, speech recognition, OCR, OpenVINO IR, deep
:keywords: OpenVINO™ toolkit, Jupyter, Jupyter notebooks, tutorials, Python
API, Python, deep learning, inference, model inference, infer a
model, Binder, object detection, quantization, image
classification, speech recognition, OCR, OpenVINO IR, deep
learning model, AI, neural networks

.. toctree::
Expand All @@ -22,21 +22,21 @@
notebooks-installation
notebooks/notebooks

This collection of Python tutorials are written for running on Jupyter notebooks.
The tutorials provide an introduction to the OpenVINO™ toolkit and explain how to
use the Python API and tools for optimized deep learning inference. You can run the
code one section at a time to see how to integrate your application with OpenVINO
This collection of Python tutorials are written for running on Jupyter notebooks.
The tutorials provide an introduction to the OpenVINO™ toolkit and explain how to
use the Python API and tools for optimized deep learning inference. You can run the
code one section at a time to see how to integrate your application with OpenVINO
libraries.

Notebooks with a |binder logo| button can be run without installing anything.
Once you have found the tutorial of your interest, just click the button next to
Notebooks with a |binder logo| button can be run without installing anything.
Once you have found the tutorial of your interest, just click the button next to
the name of it and `Binder <https://mybinder.org/>`__ will start it in a new tab of a browser.
Binder is a free online service with limited resources (for more information about it,
see the `Additional Resources <#-additional-resources>`__ section).

.. note::
For the best performance, more control and resources, you should run the notebooks locally.
Follow the `Installation Guide <notebooks-installation.html>`__ in order to get information
For the best performance, more control and resources, you should run the notebooks locally.
Follow the `Installation Guide <notebooks-installation.html>`__ in order to get information
on how to run and manage the notebooks on your machine.


Expand Down Expand Up @@ -118,7 +118,7 @@ Tutorials that explain how to optimize and quantize models with OpenVINO tools.
| `105-language-quantize-bert <notebooks/105-language-quantize-bert-with-output.html>`__ | Optimize and quantize a pre-trained BERT model |
+------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
| `106-auto-device <notebooks/106-auto-device-with-output.html>`__ | Demonstrates how to use AUTO Device |
+------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
+------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
| `107-speech-recognition-quantization <notebooks/107-speech-recognition-quantization-with-output.html>`__ | Optimize and quantize a pre-trained Wav2Vec2 speech model |
+------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
| `110-ct-segmentation-quantize <notebooks/110-ct-segmentation-quantize-with-output.html>`__ | Quantize a kidney segmentation model and show live inference |
Expand Down Expand Up @@ -210,6 +210,9 @@ Demos that demonstrate inference on a particular model.
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
| `228-clip-zero-shot-image-classification <notebooks/228-clip-zero-shot-image-classification-with-output.html>`__ | Perform Zero-shot Image Classification with CLIP and OpenVINO | |n228-img1| |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
| `229-distilbert-sequence-classification <notebooks/229-distilbert-sequence-classification-with-output.html>`__ | Sequence Classification with OpenVINO | |n229-img1| |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+



.. raw:: html
Expand All @@ -219,7 +222,7 @@ Demos that demonstrate inference on a particular model.
`Model Training`_
------------------

Tutorials that include code to train neural networks.
Tutorials that include code to train neural networks.


+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
Expand Down Expand Up @@ -409,6 +412,8 @@ Made with `contributors-img <https://contrib.rocks>`__.
:target: https://user-images.githubusercontent.com/29454499/204548693-1304ef33-c790-490d-8a8b-d5766acb6254.png
.. |n228-img1| image:: https://user-images.githubusercontent.com/29454499/207795060-437b42f9-e801-4332-a91f-cc26471e5ba2.png
:target: https://user-images.githubusercontent.com/29454499/207795060-437b42f9-e801-4332-a91f-cc26471e5ba2.png
.. |n229-img1| image:: https://user-images.githubusercontent.com/95271966/206130638-d9847414-357a-4c79-9ca7-76f4ae5a6d7f.png
:target: https://user-images.githubusercontent.com/95271966/206130638-d9847414-357a-4c79-9ca7-76f4ae5a6d7f.png
.. |n301-img1| image:: https://user-images.githubusercontent.com/15709723/127779607-8fa34947-1c35-4260-8d04-981c41a2a2cc.png
:target: https://user-images.githubusercontent.com/15709723/127779607-8fa34947-1c35-4260-8d04-981c41a2a2cc.png
.. |n401-img1| image:: https://user-images.githubusercontent.com/4547501/141471665-82b28c86-cf64-4bfe-98b3-c314658f2d96.gif
Expand Down Expand Up @@ -497,4 +502,3 @@ Made with `contributors-img <https://contrib.rocks>`__.


@endsphinxdirective

9 changes: 4 additions & 5 deletions samples/cpp/benchmark_app/statistics_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void StatisticsReport::add_parameters(const Category& category, const Parameters
}

void StatisticsReport::dump() {
CsvDumper dumper(true, _config.report_folder + _separator + "benchmark_report.csv");
CsvDumper dumper(true, _config.report_folder + _separator + "benchmark_report.csv", 3);

auto dump_parameters = [&dumper](const Parameters& parameters) {
for (auto& parameter : parameters) {
Expand Down Expand Up @@ -88,7 +88,7 @@ void StatisticsReport::dump_performance_counters_request(CsvDumper& dumper, cons
? status_names[(int)layer.status]
: "INVALID_STATUS");
dumper << layer.node_type << layer.exec_type;
dumper << std::to_string(layer.real_time.count() / 1000.0) << std::to_string(layer.cpu_time.count() / 1000.0);
dumper << layer.real_time.count() / 1000.0 << layer.cpu_time.count() / 1000.0;
total += layer.real_time;
total_cpu += layer.cpu_time;
dumper.endLine();
Expand Down Expand Up @@ -135,8 +135,7 @@ void StatisticsReport::dump_sort_performance_counters_request(CsvDumper& dumper,
? status_names[(int)layer.status]
: "INVALID_STATUS");
dumper << layer.node_type << layer.exec_type;
dumper << std::to_string(layer.real_time.count() / 1000.0)
<< std::to_string(layer.cpu_time.count() / 1000.0);
dumper << layer.real_time.count() / 1000.0 << layer.cpu_time.count() / 1000.0;
dumper << (layer.real_time * 1.0 / total) * 100;
dumper.endLine();
layersize += 1;
Expand Down Expand Up @@ -191,7 +190,7 @@ void StatisticsReport::dump_performance_counters(const std::vector<PerformanceCo
slog::info << "Performance counters are empty. No reports are dumped." << slog::endl;
return;
}
CsvDumper dumper(true, _config.report_folder + _separator + "benchmark_" + _config.report_type + "_report.csv");
CsvDumper dumper(true, _config.report_folder + _separator + "benchmark_" + _config.report_type + "_report.csv", 3);
if (_config.report_type == detailedCntReport) {
for (auto& pc : perfCounts) {
dump_performance_counters_request(dumper, pc);
Expand Down
Loading

0 comments on commit dc2f206

Please sign in to comment.