This class represents an Inference Engine entity and allows you to manipulate with plugins using unified interfaces. More...
Public Member Functions | |
def | __init__ (self, xml_config_file) |
Class constructor. More... | |
def | get_versions (self, device_name) |
Get a namedtuple object with versions of the plugin specified. More... | |
def | read_network (self, model, weights, init_from_buffer) |
Reads a network from the Intermediate Representation (IR) and creates an IENetwork . More... | |
def | load_network (self, network, device_name, config=None, num_requests=1) |
Loads a network that was read from the Intermediate Representation (IR) to the plugin with specified device name and creates an ExecutableNetwork object of the IENetwork class. More... | |
def | import_network (self, model_file, device_name, config=None, num_requests=1) |
Creates an executable network from a previously exported network. More... | |
def | query_network (self, network, device_name, config=None) |
Queries the plugin with specified device name what network layers are supported in the current configuration. More... | |
def | set_config (self, config, device_name) |
Sets a configuration for a plugin. More... | |
def | register_plugin (self, plugin_name, device_name) |
Registers plugins specified in an .xml configuration file. More... | |
def | register_plugins (self, xml_config_file) |
Registers plugins specified in an .xml configuration file. More... | |
def | unregister_plugin (self, device_name) |
Unregisters a plugin with a specified device name. More... | |
def | add_extension (self, extension_path, device_name) |
Loads extension library to the plugin with a specified device name. More... | |
def | get_metric (self, device_name, metric_name) |
Gets a general runtime metric for dedicated hardware. More... | |
def | get_config (self, device_name, config_name) |
Gets a configuration dedicated to device behavior. More... | |
def | available_devices (self) |
A list of devices. More... | |
Data Fields | |
available_devices | |
A list of devices. More... | |
This class represents an Inference Engine entity and allows you to manipulate with plugins using unified interfaces.
def ie_api.IECore.__init__ | ( | self, | |
xml_config_file | |||
) |
Class constructor.
xml_config_file | A full path to .xml file containing plugins configuration. If the parameter is not specified, the default configuration is handled automatically. |
def ie_api.IECore.add_extension | ( | self, | |
extension_path, | |||
device_name | |||
) |
Loads extension library to the plugin with a specified device name.
extension_path | Path to the extensions library file to load to a plugin |
device_name | A device name of a plugin to load the extensions to |
Usage example:
def ie_api.IECore.available_devices | ( | self | ) |
A list of devices.
The devices are returned as [CPU, FPGA.0, FPGA.1, MYRIAD]. If there are more than one device of a specific type, they all are listed followed by a dot and a number.
def ie_api.IECore.get_config | ( | self, | |
device_name, | |||
config_name | |||
) |
Gets a configuration dedicated to device behavior.
The method targets to extract information which can be set via set_config method.
device_name | A name of a device to get a config value. |
config_name | A config name to request. |
Usage example:
def ie_api.IECore.get_metric | ( | self, | |
device_name, | |||
metric_name | |||
) |
Gets a general runtime metric for dedicated hardware.
Enables to request common device properties, which are ExecutableNetwork
agnostic, such as device name, temperature, and other devices-specific values.
device_name | A name of a device to get a metric value. |
metric_name | A metric name to request. |
Usage example:
def ie_api.IECore.get_versions | ( | self, | |
device_name | |||
) |
Get a namedtuple
object with versions of the plugin specified.
device_name | Name of the the registered plugin |
Versions
namedtuple
object with the following fields:major
- major plugin integer versionminor
- minor plugin integer versionbuild_number
- plugin build number stringdescription
- plugin description string def ie_api.IECore.import_network | ( | self, | |
model_file, | |||
device_name, | |||
config = None , |
|||
num_requests = 1 |
|||
) |
Creates an executable network from a previously exported network.
device_name | Name of device load executable network on |
model_file | Full path to the location of the exported file |
config | A dictionary of plugin configuration keys and their values |
num_requests | A positive integer value of infer requests to be created. Number of infer requests is limited by device capabilities. Value 0 indicates that optimal number of infer requests will be created. |
ExecutableNetwork
object Usage example:def ie_api.IECore.load_network | ( | self, | |
network, | |||
device_name, | |||
config = None , |
|||
num_requests = 1 |
|||
) |
Loads a network that was read from the Intermediate Representation (IR) to the plugin with specified device name and creates an ExecutableNetwork
object of the IENetwork
class.
You can create as many networks as you need and use them simultaneously (up to the limitation of the hardware resources).
network | A valid IENetwork instance |
device_name | A device name of a target plugin |
config | A dictionary of plugin configuration keys and their values |
num_requests | A positive integer value of infer requests to be created. Number of infer requests is limited by device capabilities. Value 0 indicates that optimal number of infer requests will be created. |
ExecutableNetwork
objectUsage example:
def ie_api.IECore.query_network | ( | self, | |
network, | |||
device_name, | |||
config = None |
|||
) |
Queries the plugin with specified device name what network layers are supported in the current configuration.
Please note that layers support depends on plugin configuration and loaded extensions.
network | A valid IENetwork instance |
device_name | A device name of a target plugin |
config | A dictionary of plugin configuration keys and their values |
Usage example:
def ie_api.IECore.read_network | ( | self, | |
model, | |||
weights, | |||
init_from_buffer | |||
) |
Reads a network from the Intermediate Representation (IR) and creates an IENetwork
.
model | A .xml , .onnx or .prototxt model file or string with IR. |
weights | A .bin file of the IR. Depending on init_from_buffer value, can be a string path or bytes with file content. |
init_from_buffer | Defines the way of how model and weights attributes are interpreted. If False , attributes are interpreted as strings with paths to .xml and .bin files of IR. If True , they are interpreted as Python bytes object with .xml and .bin files content. |
IENetwork
objectUsage example:
def ie_api.IECore.register_plugin | ( | self, | |
plugin_name, | |||
device_name | |||
) |
Registers plugins specified in an .xml
configuration file.
plugin_name | A name of a plugin. Depending on a platform, plugin_name is wrapped with a shared library suffix and a prefix to identify a full name of the library |
device_name | A target device name for the plugin. If not specified, the method registers a plugin with the default name. |
Usage example:
def ie_api.IECore.register_plugins | ( | self, | |
xml_config_file | |||
) |
Registers plugins specified in an .xml
configuration file.
xml_config_file | A full path to .xml file containing plugins configuration |
Usage example:
def ie_api.IECore.set_config | ( | self, | |
config, | |||
device_name | |||
) |
Sets a configuration for a plugin.
config | a dictionary of configuration parameters as keys and their values |
device_name | a device name of a target plugin |
Usage examples:
def ie_api.IECore.unregister_plugin | ( | self, | |
device_name | |||
) |
Unregisters a plugin with a specified device name.
device_name | A device name of the plugin to unregister |
Usage example:
ie_api.IECore.available_devices |
A list of devices.
The devices are returned as [CPU, FPGA.0, FPGA.1, MYRIAD]. If there are more than one device of a specific type, they all are listed followed by a dot and a number.