VisionHeatmaps.jl
Documentation for VisionHeatmaps.jl.
Installation
To install this package and its dependencies, open the Julia REPL and run
]add VisionHeatmapsAPI
VisionHeatmaps.heatmap — Functionheatmap(x::AbstractArray)
heatmap(x::AbstractArray, pipeline)
heatmap(x::AbstractArray, image)
heatmap(x::AbstractArray, image, pipeline)Visualize 4D arrays as heatmaps, assuming the WHCN convention for input array dimensions (width, height, color channels, batch dimension).
heatmap(expl::Explanation)
heatmap(expl::Explanation, pipeline)
heatmap(expl::Explanation, image)
heatmap(expl::Explanation, image, pipeline)Visualize Explanation from XAIBase as a vision heatmap. Assumes WHCN convention (width, height, channels, batch dimension) for explanation.val. This will use the default heatmapping style for the given type of explanation.
heatmap(input::AbstractArray, analyzer::AbstractXAIMethod)
heatmap(input::AbstractArray, analyzer::AbstractXAIMethod, image)Compute an Explanation for a given input using the XAI method analyzer and visualize it as a vision heatmap. This will use the default heatmapping style for the given type of explanation.
VisionHeatmaps.Pipeline — TypePipeline(transforms...)Heatmapping pipelines sequentially apply transforms.
VisionHeatmaps.AbstractTransform — TypeAbstractTransformAbstract supertype for all heatmapping transforms. Custom transforms must implement an apply method.
Color-channel reduction
VisionHeatmaps.NormReduction — TypeNormReduction()Computes 2-norm over color channels
VisionHeatmaps.SumReduction — TypeSumReduction()Sums up color channels.
VisionHeatmaps.MaxAbsReduction — TypeMaxAbsReduction()Computes maximum(abs, x) over color channels
VisionHeatmaps.SumAbsReduction — TypeSumAbsReduction()Computes sum(abs, x) over color channels
VisionHeatmaps.AbsSumReduction — TypeAbsSumReduction()Computes abs(sum(x)) the color channels
Manipulating array dimensions
VisionHeatmaps.FlipImage — TypeFlipImage()Permutes the width and height dimensions of an array. Assumes width and height are the leading directions in the array.
VisionHeatmaps.PermuteDims — TypePermuteDims(dims...)Permutes arrays according to the specified dimensions.
VisionHeatmaps.DropDims — TypeDropDims(dims...)Drops specified singleton array dimensions.
Outlier removal
VisionHeatmaps.PercentileClip — TypePercentileClip()
PercentileClip(lower, upper)Clip values outside of the specified percentiles of values. Bounds default to 0.001 and 0.999 (99.9% percentiles).
Colormaps
Turn numerical arrays to images by applying color schemes:
VisionHeatmaps.ExtremaColormap — TypeExtremaColormap(name::Symbol)
ExtremaColormap(name::Symbol, colorscheme)Apply a sequential colorscheme from ColorSchemes.jl, turning an array of values into an image. Defaults to :batlow.
VisionHeatmaps.CenteredColormap — TypeCenteredColormap(name::Symbol)
CenteredColormap(name::Symbol, colorscheme)Apply a divergent colorscheme from ColorSchemes.jl, turning an array of values into an image. Defaults to :berlin.
Resizing
VisionHeatmaps.ResizeToImage — TypeResizeToImage()
ResizeToImage(method)Resize the heatmap to match the image dimensions. In some cases, this is needed for overlays. Defaults to Lanczos(1) from Interpolations.jl.
Image overlays
VisionHeatmaps.AlphaOverlay — TypeAlphaOverlay()
AlphaOverlay(alpha)Overlays a heatmap on top of an image. The opacity alpha of the heatmap defaults to 0.6.