From 6e14890972c8754b9730037e48eeb75ab607ce82 Mon Sep 17 00:00:00 2001 From: Sergey Lyubimtsev Date: Mon, 19 Jul 2021 11:57:51 +0300 Subject: [PATCH] Align folder structure for Benchmark Tool (#6625) * openvino namespace for benchmark tool * change readme wording * remove duplicated README.md --- tools/.gitignore | 6 +++++- tools/CMakeLists.txt | 10 +++------- tools/README.md | 18 +++++++++++------- .../openvino/tools}/benchmark/README.md | 0 .../openvino/tools}/benchmark/__init__.py | 0 .../openvino/tools}/benchmark/benchmark.py | 0 .../openvino/tools}/benchmark/main.py | 0 .../openvino/tools}/benchmark/parameters.py | 0 .../openvino/tools}/benchmark/requirements.txt | 0 .../tools}/benchmark/utils/__init__.py | 0 .../tools}/benchmark/utils/constants.py | 0 .../tools}/benchmark/utils/inputs_filling.py | 0 .../openvino/tools}/benchmark/utils/logging.py | 0 .../tools}/benchmark/utils/progress_bar.py | 0 .../benchmark/utils/statistics_report.py | 0 .../openvino/tools}/benchmark/utils/utils.py | 0 tools/{ => benchmark_tool}/setup.py | 13 ++++--------- 17 files changed, 23 insertions(+), 24 deletions(-) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/README.md (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/__init__.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/benchmark.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/main.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/parameters.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/requirements.txt (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/utils/__init__.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/utils/constants.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/utils/inputs_filling.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/utils/logging.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/utils/progress_bar.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/utils/statistics_report.py (100%) rename tools/{ => benchmark_tool/openvino/tools}/benchmark/utils/utils.py (100%) rename tools/{ => benchmark_tool}/setup.py (75%) diff --git a/tools/.gitignore b/tools/.gitignore index 030708655c8..dc31bf57524 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -1,2 +1,6 @@ -openvino.tools.benchmark.log +*.log +*.egg-info/ +*.egg __pycache__/ +build/ +dist/ diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 1e3f8722ee4..5469ac09336 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -23,7 +23,7 @@ if(ENABLE_PYTHON) # creates a copy inside bin directory for developers to have ability running python benchmark_app add_custom_target(${TARGET_NAME} ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/tools - COMMAND ${CMAKE_COMMAND} -E copy_directory ${OpenVINO_SOURCE_DIR}/tools/benchmark ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/tools/benchmark + COMMAND ${CMAKE_COMMAND} -E copy_directory ${OpenVINO_SOURCE_DIR}/tools/benchmark_tool/openvino/tools/benchmark ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/tools/benchmark ) ie_cpack_add_component(python_tools_${PYTHON_VERSION}) @@ -37,14 +37,10 @@ if(ENABLE_PYTHON) DESTINATION deployment_tools/tools COMPONENT python_tools) - install(FILES README.md - DESTINATION python/${PYTHON_VERSION}/openvino/tools - COMPONENT python_tools_${PYTHON_VERSION}) - - install(DIRECTORY benchmark + install(DIRECTORY benchmark_tool/openvino/tools/benchmark DESTINATION python/${PYTHON_VERSION}/openvino/tools USE_SOURCE_PERMISSIONS COMPONENT python_tools_${PYTHON_VERSION}) - + ie_cpack(python_tools python_tools_${PYTHON_VERSION}) endif() diff --git a/tools/README.md b/tools/README.md index 5abaf9566a5..2b978ff1087 100644 --- a/tools/README.md +++ b/tools/README.md @@ -1,13 +1,12 @@ -# OpenVINO™ Python* openvino.tools package +# OpenVINO™ Python* development tools ## General -`openvino.tools` package includes: +OpenVINO includes following tools: * openvino.tools.benchmark Please, refer to https://docs.openvinotoolkit.org for details. ## Installation -Choose necessary Python\* version and define `PYTHONPATH` environment variable. ### Prerequisites @@ -15,11 +14,12 @@ Install prerequisites first: #### 1. Python -**openvino.tools** is **Python 3** library. Install it first: +Install **Python** prerequisites: - [Python3][python3] - [setuptools][setuptools] +Run following command to install these prerequisites on Ubuntu*: ```bash sudo apt-get install python3 python3-dev python3-setuptools python3-pip ``` @@ -49,13 +49,17 @@ Virtual environment can be deactivated using command deactivate ``` -#### 2. Install package prerequisites +#### 2. Install packages -The next step is installing package prerequisites. +You can install tools by specifying path to tool with `setup.py` in `pip install` command: ```bash -python3 -m pip install -r benchmark/requirements.txt +python3 -m pip install / ``` +For example, to install Benchmark Tool, use the following command: +```bash +python3 -m pip install benchmark_tool/ + ``` ### Configuration diff --git a/tools/benchmark/README.md b/tools/benchmark_tool/openvino/tools/benchmark/README.md similarity index 100% rename from tools/benchmark/README.md rename to tools/benchmark_tool/openvino/tools/benchmark/README.md diff --git a/tools/benchmark/__init__.py b/tools/benchmark_tool/openvino/tools/benchmark/__init__.py similarity index 100% rename from tools/benchmark/__init__.py rename to tools/benchmark_tool/openvino/tools/benchmark/__init__.py diff --git a/tools/benchmark/benchmark.py b/tools/benchmark_tool/openvino/tools/benchmark/benchmark.py similarity index 100% rename from tools/benchmark/benchmark.py rename to tools/benchmark_tool/openvino/tools/benchmark/benchmark.py diff --git a/tools/benchmark/main.py b/tools/benchmark_tool/openvino/tools/benchmark/main.py similarity index 100% rename from tools/benchmark/main.py rename to tools/benchmark_tool/openvino/tools/benchmark/main.py diff --git a/tools/benchmark/parameters.py b/tools/benchmark_tool/openvino/tools/benchmark/parameters.py similarity index 100% rename from tools/benchmark/parameters.py rename to tools/benchmark_tool/openvino/tools/benchmark/parameters.py diff --git a/tools/benchmark/requirements.txt b/tools/benchmark_tool/openvino/tools/benchmark/requirements.txt similarity index 100% rename from tools/benchmark/requirements.txt rename to tools/benchmark_tool/openvino/tools/benchmark/requirements.txt diff --git a/tools/benchmark/utils/__init__.py b/tools/benchmark_tool/openvino/tools/benchmark/utils/__init__.py similarity index 100% rename from tools/benchmark/utils/__init__.py rename to tools/benchmark_tool/openvino/tools/benchmark/utils/__init__.py diff --git a/tools/benchmark/utils/constants.py b/tools/benchmark_tool/openvino/tools/benchmark/utils/constants.py similarity index 100% rename from tools/benchmark/utils/constants.py rename to tools/benchmark_tool/openvino/tools/benchmark/utils/constants.py diff --git a/tools/benchmark/utils/inputs_filling.py b/tools/benchmark_tool/openvino/tools/benchmark/utils/inputs_filling.py similarity index 100% rename from tools/benchmark/utils/inputs_filling.py rename to tools/benchmark_tool/openvino/tools/benchmark/utils/inputs_filling.py diff --git a/tools/benchmark/utils/logging.py b/tools/benchmark_tool/openvino/tools/benchmark/utils/logging.py similarity index 100% rename from tools/benchmark/utils/logging.py rename to tools/benchmark_tool/openvino/tools/benchmark/utils/logging.py diff --git a/tools/benchmark/utils/progress_bar.py b/tools/benchmark_tool/openvino/tools/benchmark/utils/progress_bar.py similarity index 100% rename from tools/benchmark/utils/progress_bar.py rename to tools/benchmark_tool/openvino/tools/benchmark/utils/progress_bar.py diff --git a/tools/benchmark/utils/statistics_report.py b/tools/benchmark_tool/openvino/tools/benchmark/utils/statistics_report.py similarity index 100% rename from tools/benchmark/utils/statistics_report.py rename to tools/benchmark_tool/openvino/tools/benchmark/utils/statistics_report.py diff --git a/tools/benchmark/utils/utils.py b/tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py similarity index 100% rename from tools/benchmark/utils/utils.py rename to tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py diff --git a/tools/setup.py b/tools/benchmark_tool/setup.py similarity index 75% rename from tools/setup.py rename to tools/benchmark_tool/setup.py index 87b00e23dba..31ce11e4a36 100644 --- a/tools/setup.py +++ b/tools/benchmark_tool/setup.py @@ -10,18 +10,15 @@ $ python setup.py sdist bdist_wheel """ from setuptools import setup, find_packages -with open('README.md', 'r', encoding='utf-8') as f: +with open('openvino/tools/benchmark/README.md', 'r', encoding='utf-8') as f: long_description = f.read() -with open('benchmark/requirements.txt') as f: +with open('openvino/tools/benchmark/requirements.txt') as f: required = f.read().splitlines() required.extend(['openvino']) -pkgs = find_packages() -NAMESPACE = 'openvino.tools' - setup( - name='openvino-tools', + name='benchmark_tool', version='0.0.0', author='Intel® Corporation', license='OSI Approved :: Apache Software License', @@ -39,9 +36,7 @@ setup( 'OSI Approved :: Apache Software License', 'Operating System :: OS Independent', ], - package_dir={''.join((NAMESPACE, '.', pkg)) : pkg.replace('.', '/') - for pkg in pkgs}, - packages=[''.join((NAMESPACE, '.', pkg)) for pkg in pkgs], + packages=find_packages(), install_requires=required, python_requires='>=3.6', )