openvino.inference_engine.PreProcessInfo

class openvino.inference_engine.PreProcessInfo

Bases: object

OpenVINO Inference Engine Python API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html

This class stores pre-process information for the input

__init__()

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getitem__(key, /)

Return self[key].

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__()

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__

PreProcessInfo.__reduce_cython__(self)

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__setstate__

PreProcessInfo.__setstate_cython__(self, __pyx_state)

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

get_number_of_channels(self)

Returns a number of channels to preprocess

init(self, size_t number_of_channels)

Initializes with given number of channels

set_mean_image(self, Blob mean_image)

Sets mean image values if operation is applicable.

set_mean_image_for_channel(self, ...)

Sets mean image values if operation is applicable.

Attributes

color_format

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

mean_variant

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

resize_algorithm

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

__class__

alias of type

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getitem__(key, /)

Return self[key].

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__()
__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)
__reduce__()

PreProcessInfo.__reduce_cython__(self)

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__setstate__()

PreProcessInfo.__setstate_cython__(self, __pyx_state)

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

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
get_number_of_channels(self)

Returns a number of channels to preprocess

init(self, size_t number_of_channels)

Initializes with given number of channels

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

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(self, Blob 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(self, Blob mean_image, size_t channel)

Sets mean image values if operation is applicable. Also sets the mean type to MEAN_IMAGE for a particular channel