Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

Python front end support for OpenVINO tool kit

Sreedhar_V_Intel
Employee
820 Views

Hi,

Is there a plan to enable Python front end support for Open VINO tool kit?

 

0 Kudos
1 Solution
Severine_H_Intel
Employee
820 Views

Dear Sreedhar,

We have a Python API for the IE and you can see it in use in our Python samples in the R2 and R3 release. The samples can be found in the samples folder at the following path: computer_vision_sdk_2018.3.343\deployment_tools\inference_engine\samples\python_samples.

Best, 

Severine

 

View solution in original post

0 Kudos
4 Replies
Mark_L_Intel1
Moderator
820 Views

Hi Sreedhar,

Can you more specific what "Python front end" mean?

Mark

0 Kudos
Sreedhar_V_Intel
Employee
820 Views

Is it possible to use Python as front end to develop sample[eg:hello_classification/main.cpp] with inference engine?

0 Kudos
Severine_H_Intel
Employee
821 Views

Dear Sreedhar,

We have a Python API for the IE and you can see it in use in our Python samples in the R2 and R3 release. The samples can be found in the samples folder at the following path: computer_vision_sdk_2018.3.343\deployment_tools\inference_engine\samples\python_samples.

Best, 

Severine

 

0 Kudos
Mark_L_Intel1
Moderator
820 Views

Hi Sreedhar,

As a start point, you can run python API from the command line which gives you a convenient to do a quick try.

But you have to run the shell script to set up PYTHONPATH:

$ source <OpenVINO Install Dir>/bin/setupvars.sh
$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from openvino.inference_engine import *
>>> net = IENetwork.from_ir(model="<OpenVINO Install Dir>/deployment_tools/intel_models/face-detection-retail-0004/FP32/face-detection-retail-0004.xml",weights="<OpenVINO Install Dir>/deployment_tools/intel_models/face-detection-retail-0004/FP32/face-detection-retail-0004.bin")
>>> from openvino.inference_engine import *
>>> plugin = IEPlugin(device="HETERO:FPGA,CPU")
>>> plugin.set_config({"TARGET_FALLBACK": "HETERO:FPGA,CPU"})
>>> plugin.set_initial_affinity(net)
>>> for l in net.layers.values():
...     if l.type == "Convolution":
...             l.affinity = "CPU"
... 
>>> 
[2]+  Stopped                 python3

You can refer to the Python API introductions for further help.

Mark

0 Kudos
Reply