public class ExampleImage extends Object implements MLDataItem
Constructor and Description |
---|
ExampleImage(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 information
|
ExampleImage(String imgFile,
String label) |
Modifier and Type | Method and Description |
---|---|
File |
getFile() |
int |
getHeight() |
Tensor |
getInput()
Returns an input for machine learning model of this item.
|
String |
getLabel() |
BufferedImage |
getOriginalImageFromFile() |
float[] |
getRgbVector() |
Tensor |
getTargetOutput()
Returns target output for machine learning model of this item.
|
int |
getWidth() |
void |
invert() |
void |
setTargetOutput(Tensor targetOutput) |
public ExampleImage(String imgFile, String label) throws IOException
IOException
public ExampleImage(File imgFile, String label) throws IOException
imgFile
- image filelabel
- image labelIOException
- if file is not found or reading file fails from some reason.public ExampleImage(BufferedImage image, String label)
public ExampleImage(BufferedImage image, String label, int channels)
public ExampleImage(File originalImgFile, BufferedImage image, String label)
public ExampleImage(BufferedImage image)
public ExampleImage(BufferedImage image, String label, int targetWidth, int targetHeight) throws IOException
IOException
public void invert()
public Tensor getTargetOutput()
MLDataItem
getTargetOutput
in interface MLDataItem
public float[] getRgbVector()
public final void setTargetOutput(Tensor targetOutput)
public int getWidth()
public int getHeight()
public String getLabel()
public Tensor getInput()
MLDataItem
getInput
in interface MLDataItem
public File getFile()
public BufferedImage getOriginalImageFromFile() throws IOException
IOException
Copyright © 2022. All rights reserved.