public class ScoreCAM extends AbstractCNNSaliencyMapGenerator
Constructor and Description |
---|
ScoreCAM() |
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
generateHeatmapToImage(int[] targetClasses,
java.lang.String[] classMap,
boolean normalize)
Generates heatmaps for the supplied classes, returning a human-viewable heatmap summary.
|
org.deeplearning4j.nn.conf.inputs.InputType.InputTypeConvolutional |
getModelInputShape() |
java.awt.image.BufferedImage |
imageFromINDArray(org.nd4j.linalg.api.ndarray.INDArray array)
Takes an INDArray containing an image loaded using the native image loader
libraries associated with DL4J, and converts it into a BufferedImage.
|
void |
processImage(java.io.File imageFile)
Main processing entrypoint.
|
void |
setModelInputShape(org.deeplearning4j.nn.conf.inputs.InputType.InputTypeConvolutional modelInputShape) |
addIterationIncrementListener, addIterationsFinishedListeners, addIterationsStartedListener, getBatchSize, getComputationGraph, getImagePreProcessingScaler, getInputFilename, getModelName, isImageChannelsLast, setBatchSize, setComputationGraph, setImageChannelsLast, setImagePreProcessingScaler, setInputFilename, setModelName
public void processImage(java.io.File imageFile)
AbstractCNNSaliencyMapGenerator
processImage
in class AbstractCNNSaliencyMapGenerator
imageFile
- File to process into saliency map.public java.awt.image.BufferedImage generateHeatmapToImage(int[] targetClasses, java.lang.String[] classMap, boolean normalize)
AbstractCNNSaliencyMapGenerator
generateHeatmapToImage
in class AbstractCNNSaliencyMapGenerator
targetClasses
- Classes to generate saliency maps for.classMap
- Appropriate class map for the supplied classes.normalize
- Should we normalize the heatmap?public org.deeplearning4j.nn.conf.inputs.InputType.InputTypeConvolutional getModelInputShape()
getModelInputShape
in class AbstractCNNSaliencyMapGenerator
public void setModelInputShape(org.deeplearning4j.nn.conf.inputs.InputType.InputTypeConvolutional modelInputShape)
setModelInputShape
in class AbstractCNNSaliencyMapGenerator
public java.awt.image.BufferedImage imageFromINDArray(org.nd4j.linalg.api.ndarray.INDArray array)
array
- INDArray containing an image in order [N, C, H, W] or [C, H, W]