Files
openvino/tools
Mikhail Nosov d20900e235 [Caching] Add caching options to benchmark app (#4909)
* Python API for LoadNetwork by model file name

* BenchmarkApp: Add caching and LoadNetworkFromFile support

    2 new options are introduced
    - cache_dir <dir> - enables models caching
    - load_from_file - use new perform "LoadNetwork" by model file name

    Using both parameters will achieve maximum performance of read/load network on startup

    Tests:
    1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support
    2) ./benchmark_app -d CPU -i <model.xml> -load_from_file
    Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc)
    3) Pre-requisite: support of caching shall be enabled for Template plugin
    ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir
    Verify that "someDir" is created and generated blob is available
    Run again, verify that loading works as well (should be faster as it will not load onnx model)
    4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created
    For some devices loadNetwork time shall be improved when cache is available

* Removed additional timing prints

* Correction from old code

* Revert "Removed additional timing prints"

Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags

* Removed new time printings

As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts

* Fix clang-format issues
2021-05-17 13:41:15 +03:00
..
2020-11-19 16:56:47 +03:00

OpenVINO™ Python* openvino.tools package

General

openvino.tools package includes:

  • openvino.tools.benchmark

Please, refer to https://docs.openvinotoolkit.org for details.

Installation

Choose necessary Python* version and define PYTHONPATH environment variable.

Prerequisites

Install prerequisites first:

1. Python

openvino.tools is Python 3 library. Install it first:

sudo apt-get install python3 python3-dev python3-setuptools python3-pip

Python setuptools and python package manager (pip) install packages into system directory by default. There are several options:

  • work inside [virtual environment][virtualenv] (best solution).
  • use --user option for all pip commands.
  • install all dependencies with sudo permissions.

In order to use virtual environment you should install it:

python3 -m pip install virtualenv
python3 -m virtualenv -p `which python3` <directory_for_environment>

Before starting to work inside virtual environment, it should be activated:

source <directory_for_environment>/bin/activate

Virtual environment can be deactivated using command

deactivate

2. Install package prerequisites

The next step is installing package prerequisites.

python3 -m pip install -r benchmark/requirements.txt

Configuration

Each subpackage has specific configuration. Please, refer to specific subpackage documentation for details.