openvino/model-optimizer
Evgeny Lazarev 717499cf2f
Common telemetry (#5032)
* Moved telemetry to repo root directory from MO

* New telemetry package in the "openvino" sub-directory

* Removed telemetry from the MO BOM

* Updated MO BOM and added stub file for telemetry

* Fixed license header

* Fixed license headers and cleaned up the telemetry setup.py

* Fixed import

* Added temporary dependency for openvino-telemetry

* Added ignore for pylint issues

* Fixed import statements

* Updated imports in the telemetry library

* Removed telemetry library. Added link to another private repo

* Removed redundant start_session event for the MO

* Changed approach to import the telemetry library

* Minor code refactoring

* Updated MO telemetry events sending messages

* Refactor sending events for the IE runtime check

* Disable forcing warnings for deprecated methods

* Removed changes from the requirements.txt to install telemetry library to avoid merge conflicts

* Update copyright in the model-optimizer/mo/utils/telemetry_stub.py

Co-authored-by: Gleb Kazantaev <gleb.nnstu@gmail.com>

Co-authored-by: Gleb Kazantaev <gleb.nnstu@gmail.com>
2021-05-14 21:56:03 +03:00
..
automation Common telemetry (#5032) 2021-05-14 21:56:03 +03:00
extensions Add Gather-7 to MO (#5264) 2021-05-11 22:29:59 +03:00
install_prerequisites %~dp0 can't handle path which include Space (#5274) 2021-04-19 18:35:32 +03:00
mo Common telemetry (#5032) 2021-05-14 21:56:03 +03:00
unit_tests Common telemetry (#5032) 2021-05-14 21:56:03 +03:00
.coveragerc Fix Gelu parameter name (#4895) 2021-03-22 19:35:32 +03:00
.pylintdict moved pylint configuration files 2020-04-15 21:46:27 +03:00
.pylintrc publish master branch snapshot, revision 0110d9c98fd7209589d06344f0d836f61d81f4b3 2020-04-27 21:21:29 +03:00
CMakeLists.txt Align copyright notice in sh, bat, cl, cc, pyx source files (#4995) 2021-03-27 01:26:27 +03:00
README.md MO dev guide refactoring (#3266) (#3595) 2021-01-14 16:28:53 +03:00
mo.py Add Model Optimizer --transform option (#5504) 2021-05-12 18:42:56 +03:00
mo_caffe.py Add Model Optimizer --transform option (#5504) 2021-05-12 18:42:56 +03:00
mo_kaldi.py Add Model Optimizer --transform option (#5504) 2021-05-12 18:42:56 +03:00
mo_mxnet.py Add Model Optimizer --transform option (#5504) 2021-05-12 18:42:56 +03:00
mo_onnx.py Add Model Optimizer --transform option (#5504) 2021-05-12 18:42:56 +03:00
mo_tf.py Add Model Optimizer --transform option (#5504) 2021-05-12 18:42:56 +03:00
requirements.txt Align MO pip requirements (#5171) 2021-05-14 16:05:25 +03:00
requirements_caffe.txt Align MO pip requirements (#5171) 2021-05-14 16:05:25 +03:00
requirements_dev.txt Stick requirement version of astroid to be 2.4.2. Also fixed pylint issue with astroid==2.5 (#4365) 2021-02-16 21:34:51 +03:00
requirements_kaldi.txt Align MO pip requirements (#5171) 2021-05-14 16:05:25 +03:00
requirements_mxnet.txt Align MO pip requirements (#5171) 2021-05-14 16:05:25 +03:00
requirements_onnx.txt Align MO pip requirements (#5171) 2021-05-14 16:05:25 +03:00
requirements_tf.txt Align MO pip requirements (#5171) 2021-05-14 16:05:25 +03:00
requirements_tf2.txt Align MO pip requirements (#5171) 2021-05-14 16:05:25 +03:00
setup.py Add MO extras requires for supported DL frameworks (#5615) 2021-05-13 20:20:41 +03:00

README.md

Prerequisites

Model Optimizer requires:

  1. Python 3 or newer

  2. [Optional] Please read about use cases that require Caffe* to be available on the machine in the documentation.

Installation instructions

  1. Go to the Model Optimizer folder:
    cd PATH_TO_INSTALL_DIR/deployment_tools/model_optimizer
  1. Create virtual environment and activate it. This option is strongly recommended as it creates a Python sandbox and dependencies for the Model Optimizer do not influence global Python configuration, installed libraries etc. At the same time, special flag ensures that system-wide Python libraries are also available in this sandbox. Skip this step only if you do want to install all Model Optimizer dependencies globally:

    • Create environment:
          virtualenv -p /usr/bin/python3.6 .env3 --system-site-packages
        
    • Activate it:
        . .env3/bin/activate
      
  2. Install dependencies. If you want to convert models only from particular framework, you should use one of available requirements_*.txt files corresponding to the framework of choice. For example, for Caffe use requirements_caffe.txt and so on. When you decide to switch later to other frameworks, please install dependencies for them using the same mechanism:

    pip3 install -r requirements.txt
    

    Or you can use the installation scripts from the "install_prerequisites" directory.

  3. [OPTIONAL] If you use Windows OS, most probably you get python version of protobuf library. It is known to be rather slow, and you can use a boosted version of library by building the .egg file (Python package format) yourself, using instructions below (section 'How to boost Caffe model loading') for the target OS and Python, or install it with the pre-built .egg (it is built for Python 3.4, 3.5, 3.6, 3.7):

         python3 -m easy_install protobuf-3.6.1-py3.6-win-amd64.egg
    

    It overrides the protobuf python package installed by the previous command.

    Set environment variable to enable boost in protobuf performance:

         set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
    

Setup development environment

How to run unit-tests

  1. Run tests with:
    python -m unittest discover -p "*_test.py" [-s PATH_TO_DIR]

How to capture unit-tests coverage

  1. Run tests with:
    coverage run -m unittest discover -p "*_test.py" [-s PATH_TO_DIR]
  1. Build html report:
    coverage html

How to run code linting

  1. Run the following command:
    pylint mo/ extensions/ mo.py