Package deepnetts.data
Class ExampleImage
java.lang.Object
deepnetts.data.ExampleImage
- All Implemented Interfaces:
MLDataItem
Example image to train a deep learning model.
It holds image pixels and corresponding label.
-
Constructor Summary
ConstructorsConstructorDescriptionExampleImage(BufferedImage image) ExampleImage(BufferedImage image, String label) ExampleImage(BufferedImage image, String label, int channels) ExampleImage(BufferedImage image, String label, int targetWidth, int targetHeight) ExampleImage(File originalImgFile, BufferedImage image, String label) ExampleImage(File imgFile, String label) Creates an instance of new example image with specified image and label Loads image from specified file and creates matrix structures with color informationExampleImage(String imgFile, String label) -
Method Summary
Modifier and TypeMethodDescriptionfloatgetError()Returns a model output error for this data item.getFile()intgetInput()Returns an input for machine learning model of this item.getLabel()float[]Returns target output for machine learning model of this item.intgetWidth()voidinvert()voidsetError(float error) final voidsetTargetOutput(TensorBase targetOutput)
-
Constructor Details
-
ExampleImage
- Throws:
IOException
-
ExampleImage
Creates an instance of new example image with specified image and label Loads image from specified file and creates matrix structures with color information- Parameters:
imgFile- image filelabel- image label- Throws:
IOException- if file is not found or reading file fails from some reason.
-
ExampleImage
-
ExampleImage
-
ExampleImage
-
ExampleImage
-
ExampleImage
public ExampleImage(BufferedImage image, String label, int targetWidth, int targetHeight) throws IOException - Throws:
IOException
-
-
Method Details
-
invert
public void invert() -
getTargetOutput
Description copied from interface:MLDataItemReturns target output for machine learning model of this item.- Specified by:
getTargetOutputin interfaceMLDataItem- Returns:
- target output
-
getRgbVector
public float[] getRgbVector() -
setTargetOutput
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getLabel
-
getInput
Description copied from interface:MLDataItemReturns an input for machine learning model of this item.- Specified by:
getInputin interfaceMLDataItem- Returns:
- an example input for a machine learning model training.
-
getFile
-
getOriginalImageFromFile
- Throws:
IOException
-
getError
public float getError()Description copied from interface:MLDataItemReturns a model output error for this data item.- Specified by:
getErrorin interfaceMLDataItem- Returns:
-
setError
public void setError(float error) - Specified by:
setErrorin interfaceMLDataItem
-