This class contains the information about the network model read from IR and allows you to manipulate with some model parameters such as layers affinity and output layers. More...
Public Member Functions | |
def | __init__ (self, model, weights, init_from_buffer) |
Class constructor. More... | |
def | name (self) |
Name of the loaded network. | |
def | input_info (self) |
A dictionary that maps input layer names to InputInfoPtr objects. | |
def | inputs (self) |
def | outputs (self) |
A dictionary that maps output layer names to DataPtr objects. | |
def | batch_size (self) |
Batch size of the network. More... | |
def | batch_size (self, batch) |
def | layers (self) |
def | add_outputs (self, outputs) |
Marks any intermediate layer as output layer to retrieve the inference results from the specified layers. More... | |
def | serialize (self, path_to_xml, path_to_bin) |
Serializes the network and stores it in files. More... | |
def | reshape (self, input_shapes) |
Reshapes the network to change spatial dimensions, batch size, or any dimension. More... | |
Data Fields | |
name | |
Name of the loaded network. | |
input_info | |
A dictionary that maps input layer names to InputInfoPtr objects. | |
inputs | |
outputs | |
A dictionary that maps output layer names to DataPtr objects. | |
batch_size | |
Batch size of the network. More... | |
layers | |
This class contains the information about the network model read from IR and allows you to manipulate with some model parameters such as layers affinity and output layers.
def ie_api.IENetwork.__init__ | ( | self, | |
model, | |||
weights, | |||
init_from_buffer | |||
) |
Class constructor.
model | A .xml file of the IR or PyCapsule containing smart pointer to nGraph function. In case of passing a .xml file attribute value can be a string path or bytes with file content depending on init_from_buffer attribute value |
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. Ignored in case of IENetwork object initialization from nGraph function. |
Usage example:
Initializing IENetwork
object from IR files:
Initializing IENetwork
object bytes with content of IR files:
def ie_api.IENetwork.add_outputs | ( | self, | |
outputs | |||
) |
Marks any intermediate layer as output layer to retrieve the inference results from the specified layers.
outputs | List of layers to be set as model outputs. The list can contain strings with layer names to be set as outputs or tuples with layer name as first element and output port id as second element. In case of setting one layer as output, string or tuple with one layer can be provided. |
Usage example:
def ie_api.IENetwork.batch_size | ( | self | ) |
Batch size of the network.
Provides getter and setter interfaces to get and modify the network batch size. For example:
def ie_api.IENetwork.inputs | ( | self | ) |
A dictionary that maps input layer names to DataPtr objects
def ie_api.IENetwork.layers | ( | self | ) |
Return dictionary that maps network layer names in topological order to IENetLayer objects containing layer properties
def ie_api.IENetwork.reshape | ( | self, | |
input_shapes | |||
) |
Reshapes the network to change spatial dimensions, batch size, or any dimension.
input_shapes | A dictionary that maps input layer names to tuples with the target shape |
Usage example:
def ie_api.IENetwork.serialize | ( | self, | |
path_to_xml, | |||
path_to_bin | |||
) |
Serializes the network and stores it in files.
path_to_xml | Path to a file, where a serialized model will be stored |
path_to_bin | Path to a file, where serialized weights will be stored |
Usage example:
ie_api.IENetwork.batch_size |
Batch size of the network.
Provides getter and setter interfaces to get and modify the network batch size. For example:
ie_api.IENetwork.inputs |
A dictionary that maps input layer names to DataPtr objects
ie_api.IENetwork.layers |
Return dictionary that maps network layer names in topological order to IENetLayer objects containing layer properties