public class ImageDirectoryLoader
extends weka.core.converters.AbstractLoader
implements weka.core.converters.BatchConverter, weka.core.converters.IncrementalConverter, weka.core.CommandlineRunnable, weka.core.OptionHandler
* *
-i <directory> * Top level directory of the image dataset* *
-name <filename> (default: output.arff) * Output meta .arff filename*
Constructor and Description |
---|
ImageDirectoryLoader() |
Modifier and Type | Method and Description |
---|---|
weka.core.Instances |
createDataset()
Main entrypoint.
|
java.lang.String[] |
fileListForFolder(java.io.File folder)
Appends the folder that the image is in, to the image path.
|
weka.core.Instances |
getDataSet() |
java.io.File |
getInputDirectory() |
weka.core.Instance |
getNextInstance(weka.core.Instances structure) |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getOutputFileName() |
java.lang.String |
getRevision() |
weka.core.Instances |
getStructure() |
boolean |
isImage(java.lang.String fullImgPath)
Check whether the supplied path is a valid image.
|
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main entrypoint if invoking class independently
|
void |
postExecution() |
void |
preExecution() |
void |
run(java.lang.Object toRun,
java.lang.String[] options) |
void |
setInputDirectory(java.io.File inputDirectory) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setOutputFileName(java.lang.String outputFileName) |
void |
setSource(java.io.File dir) |
@ProgrammaticProperty @OptionMetadata(displayName="Input directory", description="Top level directory of the image dataset", commandLineParamName="i", commandLineParamSynopsis="-i <directory>", displayOrder=1) public java.io.File getInputDirectory()
public void setInputDirectory(java.io.File inputDirectory)
@ProgrammaticProperty @OptionMetadata(displayName="Output File", description="Output meta .arff filename", commandLineParamName="name", commandLineParamSynopsis="-name <filename> (default: output.arff)", displayOrder=2) public java.lang.String getOutputFileName()
public void setOutputFileName(java.lang.String outputFileName)
public boolean isImage(java.lang.String fullImgPath)
fullImgPath
- Image path.public java.lang.String[] fileListForFolder(java.io.File folder)
folder
- Folder to search.public weka.core.Instances createDataset()
public void preExecution()
preExecution
in interface weka.core.CommandlineRunnable
public void run(java.lang.Object toRun, java.lang.String[] options) throws java.lang.IllegalArgumentException
run
in interface weka.core.CommandlineRunnable
java.lang.IllegalArgumentException
public void postExecution()
postExecution
in interface weka.core.CommandlineRunnable
public weka.core.Instances getStructure()
getStructure
in interface weka.core.converters.Loader
getStructure
in class weka.core.converters.AbstractLoader
public weka.core.Instances getDataSet()
getDataSet
in interface weka.core.converters.Loader
getDataSet
in class weka.core.converters.AbstractLoader
public weka.core.Instance getNextInstance(weka.core.Instances structure)
getNextInstance
in interface weka.core.converters.Loader
getNextInstance
in class weka.core.converters.AbstractLoader
public void setSource(java.io.File dir) throws java.io.IOException
setSource
in interface weka.core.converters.Loader
setSource
in class weka.core.converters.AbstractLoader
java.io.IOException
public java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
public java.util.Enumeration<weka.core.Option> listOptions()
listOptions
in interface weka.core.OptionHandler
public java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface weka.core.OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic static void main(java.lang.String[] args)
args
- Args