Update POT tests for OMZ location in openvino/thirdparty (#9171)
* Move OMZ to thirdparty/open_model_zoo * Improve diagnostic of issues * Update path to OMZ in the Python wheel setup.py * Update POT tests for OMZ location in openvino/thirdparty * fix mo path Co-authored-by: azhogov <alexander.zhogov@intel.com>
This commit is contained in:
parent
a4518ae595
commit
4564867a44
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -57,7 +57,7 @@
|
||||
path = thirdparty/onednn_gpu
|
||||
url = https://github.com/oneapi-src/oneDNN.git
|
||||
[submodule "tools/pot/thirdparty/open_model_zoo"]
|
||||
path = tools/pot/thirdparty/open_model_zoo
|
||||
path = thirdparty/open_model_zoo
|
||||
url = https://github.com/openvinotoolkit/open_model_zoo.git
|
||||
[submodule "thirdparty/json/nlohmann_json"]
|
||||
path = thirdparty/json/nlohmann_json
|
||||
|
@ -42,13 +42,13 @@ PKG_INSTALL_CFG = {
|
||||
'extract_entry_points': True,
|
||||
},
|
||||
"accuracy_checker": {
|
||||
'src_dir': OPENVINO_DIR / 'tools' / 'pot' / 'thirdparty' / 'open_model_zoo' / 'tools' / 'accuracy_checker', # noqa:E501
|
||||
'src_dir': OPENVINO_DIR / 'thirdparty' / 'open_model_zoo' / 'tools' / 'accuracy_checker', # noqa:E501
|
||||
'black_list': ['*tests*'],
|
||||
'prefix': 'accuracy_checker',
|
||||
'extract_entry_points': True,
|
||||
},
|
||||
"omz_tools": {
|
||||
'src_dir': OPENVINO_DIR / 'tools' / 'pot' / 'thirdparty' / 'open_model_zoo' / 'tools' / 'model_tools', # noqa:E501
|
||||
'src_dir': OPENVINO_DIR / 'thirdparty' / 'open_model_zoo' / 'tools' / 'model_tools', # noqa:E501
|
||||
'black_list': [],
|
||||
'prefix': 'omz_tools',
|
||||
'extract_requirements': True,
|
||||
@ -80,6 +80,10 @@ class CustomBuild(build):
|
||||
self.announce('Installing packages', level=log.INFO)
|
||||
for cmp, cmp_data in PKG_INSTALL_CFG.items():
|
||||
self.announce(f'Processing package: {cmp}', level=log.INFO)
|
||||
if not cmp_data['src_dir'].is_dir():
|
||||
raise FileNotFoundError(
|
||||
f'The source directory was not found: {cmp_data["src_dir"]}'
|
||||
)
|
||||
subprocess.call([sys.executable, 'setup.py', 'install',
|
||||
'--root', str(SCRIPT_DIR),
|
||||
'--prefix', str(cmp_data.get("prefix"))],
|
||||
|
@ -1,28 +1,19 @@
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
try:
|
||||
from thirdparty.open_model_zoo.tools.accuracy_checker.\
|
||||
openvino.tools.accuracy_checker.evaluators.quantization_model_evaluator import create_model_evaluator
|
||||
from thirdparty.open_model_zoo.tools.accuracy_checker.openvino.tools.accuracy_checker.config import ConfigReader
|
||||
from thirdparty.open_model_zoo.tools.accuracy_checker.openvino.tools.accuracy_checker.dataset import\
|
||||
Dataset, DataProvider as DatasetWrapper
|
||||
from thirdparty.open_model_zoo.tools.accuracy_checker.openvino.tools.accuracy_checker.logging\
|
||||
import _DEFAULT_LOGGER_NAME
|
||||
import sys
|
||||
import importlib
|
||||
from pathlib import Path
|
||||
|
||||
except ImportError:
|
||||
try:
|
||||
from openvino.tools.accuracy_checker.evaluators.quantization_model_evaluator import create_model_evaluator
|
||||
from openvino.tools.accuracy_checker.config import ConfigReader
|
||||
from openvino.tools.accuracy_checker.dataset import Dataset
|
||||
from openvino.tools.accuracy_checker.logging import _DEFAULT_LOGGER_NAME
|
||||
from openvino.tools.accuracy_checker.dataset import DataProvider as DatasetWrapper
|
||||
except ImportError:
|
||||
from accuracy_checker.evaluators.quantization_model_evaluator import create_model_evaluator
|
||||
from accuracy_checker.config import ConfigReader
|
||||
from accuracy_checker.dataset import Dataset
|
||||
from accuracy_checker.logging import _DEFAULT_LOGGER_NAME
|
||||
try:
|
||||
from accuracy_checker.dataset import DataProvider as DatasetWrapper
|
||||
except ImportError:
|
||||
from accuracy_checker.dataset import DatasetWrapper
|
||||
import openvino
|
||||
|
||||
LIBS_ROOT = Path(__file__).resolve().parents[6] / 'thirdparty'
|
||||
sys.path.append(str(LIBS_ROOT / 'open_model_zoo' / 'tools' / 'accuracy_checker'))
|
||||
# pylint: disable=E0611,C0413,C0411,E0401
|
||||
importlib.reload(openvino)
|
||||
|
||||
from openvino.tools.accuracy_checker.evaluators.quantization_model_evaluator import create_model_evaluator
|
||||
from openvino.tools.accuracy_checker.config import ConfigReader
|
||||
from openvino.tools.accuracy_checker.dataset import Dataset
|
||||
from openvino.tools.accuracy_checker.logging import _DEFAULT_LOGGER_NAME
|
||||
from openvino.tools.accuracy_checker.dataset import DataProvider as DatasetWrapper
|
||||
|
@ -111,7 +111,6 @@ setup(
|
||||
long_description_content_type='text/markdown',
|
||||
url='https://software.intel.com/openvino-toolkit',
|
||||
packages=find_packages(exclude=["tests", "tests.*",
|
||||
"thirdparty", "thirdparty.*",
|
||||
"tools", "tools.*"]),
|
||||
package_data={"openvino.tools.pot.configs.hardware": ['*.json'],
|
||||
"openvino.tools.pot.api.samples": ['*.md', '*/*.md']},
|
||||
|
@ -7,10 +7,8 @@ from openvino.tools.mo import mo
|
||||
|
||||
|
||||
TEST_ROOT = Path(__file__).parent.parent.absolute()
|
||||
PROJECT_ROOT = TEST_ROOT.parent
|
||||
LIBS_ROOT = PROJECT_ROOT / 'thirdparty'
|
||||
LIBS_ROOT = Path(__file__).resolve().parents[4] / 'thirdparty'
|
||||
MO_PATH = Path(mo.__file__).parent
|
||||
AC_PATH = LIBS_ROOT / 'open_model_zoo' / 'tools' / 'accuracy_checker'
|
||||
|
||||
MODELS_PATH = TEST_ROOT / 'data' / 'models'
|
||||
REFERENCE_MODELS_PATH = TEST_ROOT / 'data' / 'reference_models'
|
||||
|
2
tools/pot/thirdparty/__init__.py
vendored
2
tools/pot/thirdparty/__init__.py
vendored
@ -1,2 +0,0 @@
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
Loading…
Reference in New Issue
Block a user