Public Member Functions | Data Fields
ie_api.PreProcessInfo Class Reference

This class stores pre-process information for the input. More...

Public Member Functions

def __init__ (self)
 
def __dealloc__ (self)
 
def get_number_of_channels (self)
 Returns a number of channels to preprocess.
 
def init (self, number_of_channels)
 Initializes with given number of channels.
 
def set_mean_image (self, mean_image)
 Sets mean image values if operation is applicable. More...
 
def set_mean_image_for_channel (self, mean_image, channel)
 Sets mean image values if operation is applicable. More...
 
def mean_variant (self)
 Mean Variant to be applied for input before inference if needed. More...
 
def mean_variant (self, variant)
 
def resize_algorithm (self)
 Resize Algorithm to be applied for input before inference if needed. More...
 
def resize_algorithm (self, alg)
 
def color_format (self)
 Color format to be used in on-demand color conversions applied to input before inference. More...
 
def color_format (self, fmt)
 

Data Fields

 mean_variant
 Mean Variant to be applied for input before inference if needed. More...
 
 resize_algorithm
 Resize Algorithm to be applied for input before inference if needed. More...
 
 color_format
 Color format to be used in on-demand color conversions applied to input before inference. More...
 

Detailed Description

This class stores pre-process information for the input.

Member Function Documentation

◆ color_format()

def ie_api.PreProcessInfo.color_format (   self)

Color format to be used in on-demand color conversions applied to input before inference.

Usage example:

net = ie_core.read_network(model=path_to_xml_file, weights=path_to_bin_file)
net.input_info['data'].preprocess_info.color_format = ColorFormat.BGR

◆ mean_variant()

def ie_api.PreProcessInfo.mean_variant (   self)

Mean Variant to be applied for input before inference if needed.

Usage example:

net = ie_core.read_network(model=path_to_xml_file, weights=path_to_bin_file)
net.input_info['data'].preprocess_info.mean_variant = MeanVariant.MEAN_IMAGE

◆ resize_algorithm()

def ie_api.PreProcessInfo.resize_algorithm (   self)

Resize Algorithm to be applied for input before inference if needed.

Note
It's need to set your input via the set_blob method.

Usage example:

net = ie_core.read_network(model=path_to_xml_file, weights=path_to_bin_file)
net.input_info['data'].preprocess_info.resize_algorithm = ResizeAlgorithm.RESIZE_BILINEAR
exec_net = ie_core.load_network(net, 'CPU')
tensor_desc = ie.TensorDesc("FP32", [1, 3, image.shape[2], image.shape[3]], "NCHW")
img_blob = ie.Blob(tensor_desc, image)
request = exec_net.requests[0]
request.set_blob('data', img_blob)
request.infer()

◆ set_mean_image()

def ie_api.PreProcessInfo.set_mean_image (   self,
  mean_image 
)

Sets mean image values if operation is applicable.

Also sets the mean type to MEAN_IMAGE for all channels

◆ set_mean_image_for_channel()

def ie_api.PreProcessInfo.set_mean_image_for_channel (   self,
  mean_image,
  channel 
)

Sets mean image values if operation is applicable.

Also sets the mean type to MEAN_IMAGE for a particular channel

Field Documentation

◆ color_format

ie_api.PreProcessInfo.color_format

Color format to be used in on-demand color conversions applied to input before inference.

Usage example:

net = ie_core.read_network(model=path_to_xml_file, weights=path_to_bin_file)
net.input_info['data'].preprocess_info.color_format = ColorFormat.BGR

◆ mean_variant

ie_api.PreProcessInfo.mean_variant

Mean Variant to be applied for input before inference if needed.

Usage example:

net = ie_core.read_network(model=path_to_xml_file, weights=path_to_bin_file)
net.input_info['data'].preprocess_info.mean_variant = MeanVariant.MEAN_IMAGE

◆ resize_algorithm

ie_api.PreProcessInfo.resize_algorithm

Resize Algorithm to be applied for input before inference if needed.

Note
It's need to set your input via the set_blob method.

Usage example:

net = ie_core.read_network(model=path_to_xml_file, weights=path_to_bin_file)
net.input_info['data'].preprocess_info.resize_algorithm = ResizeAlgorithm.RESIZE_BILINEAR
exec_net = ie_core.load_network(net, 'CPU')
tensor_desc = ie.TensorDesc("FP32", [1, 3, image.shape[2], image.shape[3]], "NCHW")
img_blob = ie.Blob(tensor_desc, image)
request = exec_net.requests[0]
request.set_blob('data', img_blob)
request.infer()

The documentation for this class was generated from the following file: