Class ImageNormalization
- java.lang.Object
-
- ai.konduit.serving.data.image.convert.config.ImageNormalization
-
public class ImageNormalization extends java.lang.Object- NONE: No image normalization will be applied
- SCALE: Divide images by maxValue/2, or divide by 255/2 if maxValue is not specified, then subtract 1.0, to give output in range [-1,1]. This is the default.
- SCALE_01: Divide images by maxValue, or divide by 255 if maxValue is not specified, to give output in range [0,1].
- SUBTRACT_MEAN: Subtract the channels by the provided meanRgb array, with values [meanRed, meanGreen, meanBlue]. out = (in - mean) for each channel. Note that if the output format is in BGR format, the meanRgb value should still be provided in RGB order
- STANDARDIZE: Subtract the channels by the provided meanRgb array, and then divide by stdRgb, where meanRgb is [meanRed, meanGreen, meanBlue], and stdRgb is [standardDeviationRed, standardDeviationGreen, standardDeviationBlue]. out = (in - mean)/std for each channel. Note that if the output format is in BGR format, the meanRgb and stdRgb values should still be provided in RGB order.
- INCEPTION: Applies inception preprocessing for inference/evaluation as described here: inception_preprocessing.py Specifically: preprocess_for_eval method: scale to [-1, 1] range. In practice this is done by dividing by 255 (assuming pixels are in range 0 to 255) to give [0, 1] then subtracting 0.5 and multiplying by 2 to give [-1, 1]. Note uses maxValue (like SCALE) if provided.
- VGG_SUBTRACT_MEAN: As per SUBTRACT_MEAN but the fixed values [meanRed, meanGreen, meanBlue] = [123.68, 116.779, 103.939]. Note the meanRgb array with these values need not be provided explicitly. If the output format is BGR, these are appropriately reordered before applying to the channels.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImageNormalization.Type
-
Field Summary
Fields Modifier and Type Field Description protected static double[]IMAGE_NET_MEAN_RGBprotected static double[]IMAGE_NET_STD_RGBImageNormalization.Typetypeprotected static double[]VGG_MEAN_RGB
-
Constructor Summary
Constructors Constructor Description ImageNormalization()ImageNormalization(ImageNormalization.Type type)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[]getImagenetMeanRgb()static double[]getImageNetStdRgb()static double[]getVggMeanRgb()
-
-
-
Field Detail
-
VGG_MEAN_RGB
protected static final double[] VGG_MEAN_RGB
-
IMAGE_NET_MEAN_RGB
protected static final double[] IMAGE_NET_MEAN_RGB
-
IMAGE_NET_STD_RGB
protected static final double[] IMAGE_NET_STD_RGB
-
type
public ImageNormalization.Type type
-
-
Constructor Detail
-
ImageNormalization
public ImageNormalization()
-
ImageNormalization
public ImageNormalization(ImageNormalization.Type type)
-
-