viewBatch | R Documentation |
Generate image grid of mini-batch of image chips and associated masks created by a DataLoader.
viewBatch(dataLoader, nCols = 3, r = 1, g = 2, b = 3, cNames, cColors)
dataLoader |
Instantiated instance of a DataLoader created using torch::dataloader(). |
nCols |
Number of columns in the image grid. Default is 3. |
r |
Index of channel to assign to red channel. Default is 1 or first channel. For gray scale or single-band images, assign the same index to all three bands. |
g |
Index of channel to assign to green channel. Default is 2 or the second channel. For gray scale or single-band images, assign the same index to all three bands. |
b |
Index of channel to assign to blue channel. Default is 3 or the third channel. For gray scale or single-band images, assign the same index to all three bands. |
cNames |
Vector of class names. Must be the same length as number of classes. |
cColors |
Vector of color values to use to display the masks. Colors are applied based on the order of class indices. Length of vector must be the same as the number of classes. |
The goal of this function is to provide a visual check of a mini-batch of image chips and associated masks generated from a DataLoader.
Image grids of example chips and masks loaded from a mini-batch produced by the DataLoader.
## Not run:
viewBatch(dataLoader=trainDL,
nCols = 5,
r = 1,
g = 2,
b = 3,
cNames=c("Background", "Mine"),
cColors=c("gray", "darksalmon"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.