2020-08-27 16:29:11 +03:00
## Software Requirements
2018-10-16 13:45:03 +03:00
- [CMake\* ](https://cmake.org/download/ ) 3.9 or later
- Microsoft\* Visual Studio 2015 or later on Windows\*
- gcc 4.8 or later on Linux
- Python 2.7 or higher on Linux\*
2021-02-08 19:16:28 +03:00
- Python 3.6 or higher on Windows\*
2018-10-16 13:45:03 +03:00
## Prerequisites
2019-01-21 21:31:31 +03:00
2. Install Inference Engine Python API dependencies:
```bash
pip3 install -r requirements.txt
```
## Building on Linux
2020-11-03 10:56:28 +03:00
Build Inference Engine Python API alongside with the Inference Engine build.
2019-01-21 21:31:31 +03:00
You need to run Inference Engine build with the following flags:
```shellscript
2021-03-02 21:33:25 +03:00
cd <INSTALL_DIR>/openvino
2019-01-21 21:31:31 +03:00
mkdir -p build
cd build
cmake -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=`which python3.6` \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 ..
make -j16
```
2018-10-16 13:45:03 +03:00
## Building on Windows
2019-01-21 21:31:31 +03:00
You need to run Inference Engine build with the following flags:
2018-10-16 13:45:03 +03:00
```shellscript
2021-03-02 21:33:25 +03:00
cd <INSTALL_DIR>/openvino
2018-10-16 13:45:03 +03:00
mkdir build
cd build
set PATH=C:\Program Files\Python36\Scripts;%PATH%
2020-11-03 10:56:28 +03:00
cmake -G "Visual Studio 15 2017 Win64" ^
2019-01-21 21:31:31 +03:00
-DENABLE_PYTHON=ON ^
2018-10-16 13:45:03 +03:00
-DPYTHON_EXECUTABLE="C:\Program Files\Python36\python.exe" ^
-DPYTHON_INCLUDE_DIR="C:\Program Files\Python36\include" ^
-DPYTHON_LIBRARY="C:\Program Files\Python36\libs\python36.lib" ..
```
2019-01-21 21:31:31 +03:00
Then build generated solution INFERENCE_ENGINE_DRIVER.sln using Microsoft\* Visual Studio or run `cmake --build . --config Release` to build from the command line.
2018-10-16 13:45:03 +03:00
2021-02-08 19:16:28 +03:00
## Building Python wheel
1) Install Inference Engine Python API dependencies:
```bash
pip3 install -r wheel/requirements-dev.txt
```
2) Install the *patchelf* tool on Linux only:
```shellscript
sudo apt install patchelf
```
3) Run Inference Engine build with the following options:
```shellscript
-DENABLE_PYTHON=ON
-DENABLE_WHEEL=ON
```
If you need to include other components to the package you need to enable them too.
For example, to include ngraph python API:
```shellscript
-NGRAPH_PYTHON_BUILD_ENABLE=ON
```
2019-01-21 21:31:31 +03:00
## Running sample
2018-12-14 21:26:38 +03:00
2019-01-21 21:31:31 +03:00
Before running the Python samples:
2020-11-03 10:56:28 +03:00
- add the folder with built `openvino` Python module (located at `bin/intel64/Release/lib/python_api/python3.6` for Linux) to the PYTHONPATH environment variable.
2018-12-14 21:26:38 +03:00
- add the folder with Inference Engine libraries to LD_LIBRARY_PATH variable on Linux (or PATH on Windows).
2019-01-21 21:31:31 +03:00
Example of command line to run classification sample:
```bash
2020-11-03 10:56:28 +03:00
python3 sample/classification_sample.py -m <path/to/xml> -i <path/to/input/image> -d CPU
2019-01-21 21:31:31 +03:00
```