ImageInspector provides simple utilities to visualize image data used in machine learning.
The package is not registered and this can be installed in the following way
(@v1.10) pkg> add https://github.com/JuliaTeachingCTU/ImageInspector.jl
The main goal of the package is to simplify the process of examining image data stored as a 3D or 4D array of numbers. This format is commonly used in machine learning, for example for training neural networks. The package consider the following assumptions about input data:
- Images are stored in the Flux style, i.e., each slice alongside the last dimension (the third or the fourth dimension) represents one image.
- Each image is stored in the width x height or width x height x color channel format.
The core of the package is the imageplot
function that can be used to visualize one or multiple images. However, this function the plotting backend to be loaded. The package currently support two backends: Plots
and Makie
.
The basic usage is the following.
using ImageInspector, Plots, MLDatasets
x = CIFAR10(split=:train).features;
imageplot(x, 1:10)
The imageplot
function provides several keyword arguments, that allow us to modify the resulting appearance of the image. For example, the number of rows and columns of the resulting grid can be set by the nrows
and ncols
keyword arguments.
inds = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]
imageplot(x, inds; nrows = 2)
The usage is the same as in the case of Plots backend
using ImageInspector, CairoMakie, MLDatasets
x = CIFAR10(split=:train).features;
imageplot(x, 1:10)
inds = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]
imageplot(x, inds; nrows = 2)