class InferenceEngine::PreProcessInfo

Overview

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

#include <ie_preprocess.hpp>

class PreProcessInfo
{
public:
    // methods

    PreProcessChannel::Ptr& operator [] (size_t index);
    const PreProcessChannel::Ptr& operator [] (size_t index) const;
    size_t getNumberOfChannels() const;
    void init(const size_t numberOfChannels);
    void setMeanImage(const Blob::Ptr& meanImage);
    void setMeanImageForChannel(const Blob::Ptr& meanImage, const size_t channel);
    void setVariant(const MeanVariant& variant);
    MeanVariant getMeanVariant() const;
    void setResizeAlgorithm(const ResizeAlgorithm& alg);
    ResizeAlgorithm getResizeAlgorithm() const;
    void setColorFormat(ColorFormat fmt);
    ColorFormat getColorFormat() const;
};

Detailed Documentation

This class stores pre-process information for the input.

Methods

PreProcessChannel::Ptr& operator [] (size_t index)

Overloaded [] operator to safely get the channel by an index.

Throws an exception if channels are empty

Parameters:

index

Index of the channel to get

Returns:

The pre-process channel instance

const PreProcessChannel::Ptr& operator [] (size_t index) const

operator [] to safely get the channel preprocessing information by index.

Throws exception if channels are empty or index is out of border

Parameters:

index

Index of the channel to get

Returns:

The const preprocess channel instance

size_t getNumberOfChannels() const

Returns a number of channels to preprocess.

Returns:

The number of channels

void init(const size_t numberOfChannels)

Initializes with given number of channels.

Parameters:

numberOfChannels

Number of channels to initialize

void setMeanImage(const Blob::Ptr& meanImage)

Sets mean image values if operation is applicable.

Also sets the mean type to MEAN_IMAGE for all channels

Parameters:

meanImage

Blob with a mean image

void setMeanImageForChannel(const Blob::Ptr& meanImage, const size_t channel)

Sets mean image values if operation is applicable.

Also sets the mean type to MEAN_IMAGE for a particular channel

Parameters:

meanImage

Blob with a mean image

channel

Index of a particular channel

void setVariant(const MeanVariant& variant)

Sets a type of mean operation.

Parameters:

variant

Type of mean operation to set

MeanVariant getMeanVariant() const

Gets a type of mean operation.

Returns:

The type of mean operation

void setResizeAlgorithm(const ResizeAlgorithm& alg)

Sets resize algorithm to be used during pre-processing.

Parameters:

alg

Resize algorithm

ResizeAlgorithm getResizeAlgorithm() const

Gets preconfigured resize algorithm.

Returns:

Resize algorithm

void setColorFormat(ColorFormat fmt)

Changes the color format of the input data provided by the user.

This function should be called before loading the network to the plugin Setting color format different from ColorFormat::RAW enables automatic color conversion (as a part of built-in preprocessing routine)

Parameters:

fmt

A new color format associated with the input

ColorFormat getColorFormat() const

Gets a color format associated with the input.

By default, the color format is ColorFormat::RAW meaning there is no particular color format assigned to the input

Returns:

Color format.