public class ImageInstanceIterator extends AbstractInstanceIterator implements ConvolutionalIterator
Constructor and Description |
---|
ImageInstanceIterator() |
Modifier and Type | Method and Description |
---|---|
void |
enforceZooModelSize(AbstractZooModel tmpZooModel)
Enforces the input image size if using a zoo model.
|
boolean |
getChannelsLast() |
org.nd4j.linalg.dataset.api.iterator.DataSetIterator |
getDataSetIterator(weka.core.Instances data,
int seed,
int batchSize)
This method returns the iterator.
|
int |
getHeight() |
java.io.File |
getImagesLocation() |
int |
getNumChannels() |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
int |
getWidth() |
java.lang.String |
globalInfo()
Return the global info for this class.
|
static boolean |
isMetaArff(weka.core.Instances data)
Are the input instances from a 'meta' arff (just points to the image location)
|
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options.
|
void |
setChannelsLast(boolean channelsLast) |
void |
setHeight(int height) |
void |
setImagesLocation(java.io.File imagesLocation) |
void |
setNumChannels(int numChannels) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setWidth(int width) |
void |
validate(weka.core.Instances data)
Validates the input dataset.
|
getDataSetIterator, getTrainBatchSize, initialize, setTrainBatchSize
@FilePropertyMetadata(fileChooserDialogType=1, directoriesOnly=true) @OptionMetadata(displayName="directory of images", description="The directory containing the images (default = user home).", commandLineParamName="imagesLocation", commandLineParamSynopsis="-imagesLocation <string>", displayOrder=1) public java.io.File getImagesLocation()
public void setImagesLocation(java.io.File imagesLocation)
@OptionMetadata(displayName="desired width", description="The desired width of the images (default = 28).", commandLineParamName="width", commandLineParamSynopsis="-width <int>", displayOrder=2) public int getWidth()
getWidth
in interface ConvolutionalIterator
public void setWidth(int width)
@OptionMetadata(displayName="desired height", description="The desired height of the images (default = 28).", commandLineParamName="height", commandLineParamSynopsis="-height <int>", displayOrder=3) public int getHeight()
getHeight
in interface ConvolutionalIterator
public void setHeight(int height)
@OptionMetadata(displayName="desired number of channels", description="The desired number of channels (default = 1).", commandLineParamName="numChannels", commandLineParamSynopsis="-numChannels <int>", displayOrder=4) public int getNumChannels()
getNumChannels
in interface ConvolutionalIterator
public void setNumChannels(int numChannels)
@OptionMetadata(displayName="Image channels last", description="Set to true to supply image channels last. The default value will usually be correct, so as an end user you shouldn\'t need to change this setting. If you do be aware that it may break the model.", commandLineParamName="channelsLast", commandLineParamSynopsis="-channelsLast <boolean>") public boolean getChannelsLast()
public void setChannelsLast(boolean channelsLast)
public void enforceZooModelSize(AbstractZooModel tmpZooModel)
tmpZooModel
- Zoo model to constrain input size topublic void validate(weka.core.Instances data) throws InvalidInputDataException
validate
in class AbstractInstanceIterator
data
- the input datasetInvalidInputDataException
- if validation is unsuccessfulpublic static boolean isMetaArff(weka.core.Instances data)
data
- Instances to verifypublic org.nd4j.linalg.dataset.api.iterator.DataSetIterator getDataSetIterator(weka.core.Instances data, int seed, int batchSize) throws java.lang.Exception
getDataSetIterator
in class AbstractInstanceIterator
data
- the dataset to useseed
- the seed for the random number generatorbatchSize
- the batch size to usejava.lang.Exception
- if the constructor cannot be constructed successfullypublic java.lang.String globalInfo()
public java.util.Enumeration<weka.core.Option> listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class AbstractInstanceIterator
public java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
getOptions
in class AbstractInstanceIterator
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface weka.core.OptionHandler
setOptions
in class AbstractInstanceIterator
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supported