3 :: Copyright (c) 2018-2020 Intel Corporation
5 :: Licensed under the Apache License, Version 2.0 (the "License");
6 :: you may not use this file except in compliance with the License.
7 :: You may obtain a copy of the License at
9 :: http://www.apache.org/licenses/LICENSE-2.0
11 :: Unless required by applicable law or agreed to in writing, software
12 :: distributed under the License is distributed on an "AS IS" BASIS,
13 :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 :: See the License for the specific language governing permissions and
15 :: limitations under the License.
18 call :GetFullPath "%ROOT%\.." ROOT
21 set "INTEL_OPENVINO_DIR=%ROOT%"
22 set "INTEL_CVSDK_DIR=%INTEL_OPENVINO_DIR%"
25 if exist "%INTEL_OPENVINO_DIR%\opencv\setupvars.bat" (
26 call "%INTEL_OPENVINO_DIR%\opencv\setupvars.bat"
28 set "OpenCV_DIR=%INTEL_OPENVINO_DIR%\opencv\x64\vc14\lib"
29 set "PATH=%INTEL_OPENVINO_DIR%\opencv\x64\vc14\bin;%PATH%"
33 if exist %INTEL_OPENVINO_DIR%\deployment_tools\model_optimizer (
34 set PYTHONPATH=%INTEL_OPENVINO_DIR%\deployment_tools\model_optimizer;%PYTHONPATH%
35 set "PATH=%INTEL_OPENVINO_DIR%\deployment_tools\model_optimizer;%PATH%"
39 set "InferenceEngine_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\share"
40 set "HDDL_INSTALL_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\external\hddl"
41 set "PATH=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\external\tbb\bin;%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\Release;%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\Debug;%HDDL_INSTALL_DIR%\bin;%PATH%"
42 if exist %INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\arch_descriptions (
43 set ARCH_ROOT_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\arch_descriptions
47 if exist %INTEL_OPENVINO_DIR%\deployment_tools\ngraph (
48 set "PATH=%INTEL_OPENVINO_DIR%\deployment_tools\ngraph\lib;%PATH%"
49 set "ngraph_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\ngraph\cmake"
52 :: Check if Python is installed
53 python3 --version 2>NUL
55 echo Error^: Python is not installed. Please install Python 3.6 or higher ^(64-bit^) from https://www.python.org/downloads/
59 :: Check Python version
60 for /F "tokens=* USEBACKQ" %%F IN (`python3 --version 2^>^&1`) DO (
64 for /F "tokens=1,2,3 delims=. " %%a in ("%version%") do (
69 if "%Major%" geq "3" (
70 if "%Minor%" geq "6" (
75 if not "%python_ver%"=="okay" (
76 echo Unsupported Python version. Please install Python 3.6 or higher ^(64-bit^) from https://www.python.org/downloads/
80 :: Check Python bitness
81 python3 -c "import sys; print(64 if sys.maxsize > 2**32 else 32)" 2 > NUL
83 echo Error^: Error during installed Python bitness detection
87 for /F "tokens=* USEBACKQ" %%F IN (`python -c "import sys; print(64 if sys.maxsize > 2**32 else 32)" 2^>^&1`) DO (
91 if not "%bitness%"=="64" (
92 echo Unsupported Python bitness. Please install Python 3.6 or higher ^(64-bit^) from https://www.python.org/downloads/
96 set PYTHONPATH=%INTEL_OPENVINO_DIR%\python\python%Major%.%Minor%;%INTEL_OPENVINO_DIR%\python\python3;%PYTHONPATH%
98 if exist %INTEL_OPENVINO_DIR%\deployment_tools\open_model_zoo\tools\accuracy_checker (
99 set PYTHONPATH=%INTEL_OPENVINO_DIR%\deployment_tools\open_model_zoo\tools\accuracy_checker;%PYTHONPATH%
102 if exist %INTEL_OPENVINO_DIR%\deployment_tools\tools\post_training_optimization_toolkit (
103 set PYTHONPATH=%INTEL_OPENVINO_DIR%\deployment_tools\tools\post_training_optimization_toolkit;%PYTHONPATH%
106 echo [setupvars.bat] OpenVINO environment initialized