Skip to content

Commit 0b1d3ec

Browse files
authored
AC: update install command (#3564)
* AC: update install command * remove special behavior for arm
1 parent f0f686a commit 0b1d3ec

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

tools/accuracy_checker/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,13 @@ You can use any of them or several at a time. For correct work, Accuracy Checker
9292
If all prerequisite are installed, then you are ready to install **Accuracy Checker**:
9393

9494
```bash
95-
python3 setup.py install
95+
python3 -m pip install .
9696
```
9797

98-
Accuracy Checker is a modular tool and have some task-specific dependencies, all specific required modules can be found in `requirements.in` file.
99-
Instead of the standard installation, you can install only the core part of the tool without additional dependencies and manage them by yourself using the following command:
100-
98+
Accuracy Checker is a modular tool and have some task-specific dependencies, all specific required modules can be found in `requirements-extra.in` file.
99+
Standard installation procedure includes only basic part, in order to obtain extra modules you can execute following command:
101100
```bash
102-
python setup.py install_core
101+
python3 -m pip install .[extra]
103102
```
104103

105104
#### Installation Troubleshooting
@@ -108,7 +107,7 @@ python setup.py install_core
108107
If you get a directory/file not found error, try manually removing the previous tool version from your environment or install the tool using following command in Accuracy Checker directory instead of setup.py install:
109108

110109
```bash
111-
pip install --upgrade --force-reinstall .
110+
python3 -m pip install --upgrade --force-reinstall .
112111
```
113112
2. If `accuracy_check` command failed with following error:
114113
```

tools/accuracy_checker/setup.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ def check_and_update_numpy(min_acceptable='1.15'):
6262
subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy>={}'.format(min_acceptable)])
6363

6464

65-
def install_dependencies_with_pip(dependencies):
66-
for dep in dependencies:
67-
if dep.startswith('#'):
68-
continue
69-
subprocess.call([sys.executable, '-m', 'pip', 'install', str(dep)])
70-
71-
7265
class CoreInstall(install_command):
7366
pass
7467

@@ -81,20 +74,22 @@ def find_version(*path):
8174

8275
raise RuntimeError("Unable to find version string.")
8376

84-
is_arm = platform.processor() == 'aarch64'
8577
long_description = read("README.md")
8678
version = find_version("openvino/tools/accuracy_checker", "__init__.py")
8779

8880

8981
def prepare_requirements():
9082
requirements_core = read('requirements-core.in').split('\n')
9183
if 'install_core' in sys.argv:
92-
return requirements_core
93-
requirements = read("requirements.in").split('\n')
94-
return requirements_core + requirements
84+
warnings.warn(
85+
'"install_core" command is deprecated and will be removed in 2023.1 release, please use "install" instead',
86+
DeprecationWarning
87+
)
88+
requirements = read("requirements-extra.in").split('\n')
89+
return requirements_core, requirements
9590

9691

97-
_requirements = prepare_requirements()
92+
_requirements, _extras = prepare_requirements()
9893

9994
try:
10095
importlib.import_module('cv2')
@@ -110,8 +105,6 @@ def prepare_requirements():
110105
+ "\n Probably due to unsuitable numpy version, will be updated")
111106
check_and_update_numpy()
112107

113-
if is_arm:
114-
install_dependencies_with_pip(_requirements)
115108

116109
setup(
117110
name="accuracy_checker",
@@ -125,9 +118,9 @@ def prepare_requirements():
125118
"convert_annotation=openvino.tools.accuracy_checker.annotation_converters.convert:main"]},
126119
zip_safe=False,
127120
python_requires='>=3.5',
128-
install_requires=_requirements if not is_arm else '',
121+
install_requires=_requirements,
129122
tests_require=[read("requirements-test.in")],
130123
cmdclass={'test': PyTest, 'install_core': CoreInstall},
131-
extras_require={'extra': ['pycocotools>=2.0.2', 'crf_beam;platform_system=="Linux"', 'torch>=0.4.0', 'torchvision>=0.2.1', 'lpips', 'soundfile',
124+
extras_require={'extra': _extras + ['pycocotools>=2.0.2', 'crf_beam;platform_system=="Linux"', 'torch>=0.4.0', 'torchvision>=0.2.1', 'lpips', 'soundfile',
132125
'kenlm @ git+https://github.com/kpu/kenlm.git@f01e12d83c7fd03ebe6656e0ad6d73a3e022bd50#egg=kenlm']}
133126
)

0 commit comments

Comments
 (0)