openvino/inference-engine/ie_bridges/python
Anastasia Kuporosova 58d8de98cc
[Python API Tests] Update ngraph and iecore tests (#2329)
Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2020-09-18 19:42:36 +03:00
..
cmake publish master branch snapshot, revision 8d31237e2c3f673cbb0f0ba110fc10f5cce1d2bb 2020-05-22 02:23:12 +03:00
docs Doc Migration (master) (#1377) 2020-07-20 17:36:08 +03:00
sample [samples] remove unused ngraph (#2156) 2020-09-10 16:04:13 +03:00
src Add exposing function signatures via Cython (#2024) 2020-09-10 19:58:45 +03:00
tests [Python API Tests] Update ngraph and iecore tests (#2329) 2020-09-18 19:42:36 +03:00
CMakeLists.txt Bump cmake version to 3.13 (#2258) 2020-09-18 18:58:12 +03:00
README.md Update README.md (#1969) 2020-08-27 16:29:11 +03:00
requirements.txt fix: inference-engine/ie_bridges/python/requirements.txt to reduce vulnerabilities (#1006) 2020-06-19 01:27:32 +03:00

README.md

Software Requirements

  • CMake* 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*
  • Python 3.4 or higher on Windows*

Prerequisites

  1. Install Inference Engine Python API dependencies:
pip3 install -r requirements.txt

Building on Linux

Build Inference Engine Python API alongside with the Inference Engine build. You need to run Inference Engine build with the following flags:

  cd <IE_ROOT>
  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

Building on Windows

You need to run Inference Engine build with the following flags:

	cd <IE_ROOT>
	mkdir build
	cd build
	set PATH=C:\Program Files\Python36\Scripts;%PATH%
	cmake -G "Visual Studio 15 2017 Win64" -T "Intel C++ Compiler 18.0" ^
		-DENABLE_PYTHON=ON ^
		-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" ..

Then build generated solution INFERENCE_ENGINE_DRIVER.sln using Microsoft* Visual Studio or run cmake --build . --config Release to build from the command line.

Running sample

Before running the Python samples:

  • add the folder with built openvino Python module (located at inference-engine/bin/intel64/Release/lib/python_api/python3.6) to the PYTHONPATH environment variable.
  • add the folder with Inference Engine libraries to LD_LIBRARY_PATH variable on Linux (or PATH on Windows).

Example of command line to run classification sample:

python3 sample/classification_sample.py -m <path/to/xml> -i <path/to/input/image> -d CPU