public abstract class AbstractCNNSaliencyMapWrapper
extends java.lang.Object
implements java.io.Serializable, weka.core.OptionHandler
| Constructor and Description |
|---|
AbstractCNNSaliencyMapWrapper() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.awt.image.BufferedImage |
generateHeatmapToImage()
Generates heatmaps, returning a human-viewable heatmap summary.
|
int |
getBatchSize() |
java.lang.String[] |
getClassMap() |
CustomModelSetup |
getCustomModelSetup() |
Dl4jMlpClassifier |
getDl4jMlpClassifier() |
boolean |
getNormalizeHeatmap() |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.io.File |
getOutputFile() |
ProgressManager |
getProgressManager() |
java.lang.String |
getTargetClassIDs() |
int[] |
getTargetClassIDsAsInt() |
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options.
|
abstract void |
processImage(java.io.File imageFile)
Main processing entrypoint.
|
void |
saveResult(java.awt.image.BufferedImage completeCompositeImage)
Save the supplied composite image to a file.
|
void |
setBatchSize(int batchSize) |
void |
setClassMap(java.lang.String[] classMap) |
void |
setCustomModelSetup(CustomModelSetup customModelSetup) |
void |
setDl4jMlpClassifier(Dl4jMlpClassifier dl4jMlpClassifier) |
void |
setNormalizeHeatmap(boolean normalizeHeatmap) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setOutputFile(java.io.File outputFileLocation) |
void |
setTargetClassIDs(java.lang.String targetClassIDs) |
void |
setTargetClassIDsAsInt(int[] targetClassIDs) |
public abstract void processImage(java.io.File imageFile)
imageFile - Image to process heatmap for.public abstract java.awt.image.BufferedImage generateHeatmapToImage()
public void saveResult(java.awt.image.BufferedImage completeCompositeImage)
completeCompositeImage - Image to save.@ProgrammaticProperty public java.lang.String[] getClassMap()
public void setClassMap(java.lang.String[] classMap)
@ProgrammaticProperty public Dl4jMlpClassifier getDl4jMlpClassifier()
public void setDl4jMlpClassifier(Dl4jMlpClassifier dl4jMlpClassifier)
@ProgrammaticProperty public CustomModelSetup getCustomModelSetup()
public void setCustomModelSetup(CustomModelSetup customModelSetup)
@OptionMetadata(displayName="Batch size",
description="The mini batch size to use for map generation",
commandLineParamName="bs",
commandLineParamSynopsis="-bs <int>",
displayOrder=1)
public int getBatchSize()
public void setBatchSize(int batchSize)
@OptionMetadata(displayName="Target Classes",
description="Output class to generate saliency maps for; default is -1 (use the highest probability class). This only needs to be set if wanting to use a non-default class from the *command line*; if using the *GUI*, the \'View Saliency Map\' window contains the interface for setting this.",
commandLineParamName="target-classes",
commandLineParamSynopsis="-target-classes <int,int,...>",
displayOrder=2)
@ProgrammaticProperty
public java.lang.String getTargetClassIDs()
public void setTargetClassIDs(java.lang.String targetClassIDs)
public int[] getTargetClassIDsAsInt()
public void setTargetClassIDsAsInt(int[] targetClassIDs)
@OptionMetadata(displayName="Output file location",
description="File for the saliency map to be saved in",
commandLineParamName="output",
commandLineParamSynopsis="-output <file location>",
displayOrder=3)
@ProgrammaticProperty
public java.io.File getOutputFile()
public void setOutputFile(java.io.File outputFileLocation)
@OptionMetadata(displayName="Normalize heatmap",
description="When generating the heatmap, should the values be normalized to be in [0, 1]",
commandLineParamName="normalize",
commandLineParamSynopsis="-normalize",
commandLineParamIsFlag=true)
@ProgrammaticProperty
public boolean getNormalizeHeatmap()
public void setNormalizeHeatmap(boolean normalizeHeatmap)
public ProgressManager getProgressManager()
public java.util.Enumeration<weka.core.Option> listOptions()
listOptions in interface weka.core.OptionHandlerpublic java.lang.String[] getOptions()
getOptions in interface weka.core.OptionHandlerpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
setOptions in interface weka.core.OptionHandleroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supported