Image to tensorπ
Takes in an image and outputs a dense tensor in a predefined format.
Inputsπ
image
: Any image.layout
: Layout of output tensor.outputType
: The data type of output tensor elements.normalizeIntensity
: A Boolean flag that enables or disables intensity range normalization. If enabled, the intensity levels of the input image are scaled by equation βout = ((in / channel_max) * max - offset) / divisorβ before they are copied to the output tensor. This is done separately for each color channel. See normalizationFactors.normalizationFactors
: A 3-by-3 matrix that contains the max, offset and divisor values for each color channel. Only the first row is used with grayscale images.
Outputsπ
tensor
: A tensor in the defined format. If the input is an RGB image, the output tensor will have three elements in the βcβ dimension. Gray images produce just one. Use color converting to convert gray levels to RGB if needed. The βwβ and βhβ dimensions will match the size of the input image. Use image scaling or cropping as a preprocessing tool to fix the tensor size if required by the application. In NCHW and NHWC layouts, the batch size (βnβ) will be one.
-
enum
Layout
π Supported data layouts.
Values:
-
enumerator
ChwLayout
π Channels, height, width.
-
enumerator
HwcLayout
π Height, width, channels.
-
enumerator
NchwLayout
π Batch, channels, height, width.
-
enumerator
NhwcLayout
π Batch, height, width, channels.
-
enumerator
-
enum
OutputType
π Supported tensor data types.
Values:
-
enumerator
Float
π
-
enumerator
Float16
π
-
enumerator
Double
π
-
enumerator
Uint8
π
-
enumerator
Int8
π
-
enumerator
Uint16
π
-
enumerator
Int16
π
-
enumerator
Uint32
π
-
enumerator
Int32
π
-
enumerator
Uint64
π
-
enumerator
Int64
π
-
enumerator
Boolean
π
-
enumerator
FloatComplex
π
-
enumerator
DoubleComplex
π
-
enumerator