LoadImageBatch: Load a batch of images.

Description Usage Arguments Details Value Examples

Description

Load a batch of images.

Usage

1
2
3
4
5
LoadImageBatch(files, loader, h, w, nch, channel_last = TRUE,
  batch_last = FALSE, ret.flatten = FALSE)

LoadPNGBatch(files, h, w, nch, channel_last = TRUE, batch_last = FALSE,
  ret.flatten = FALSE)

Arguments

files

a list of files or a list of files by channel.

loader

a function to load the images.

h

height of images. Ignored if ret.flatten.

w

width of images. Ignored if ret.flatten.

nch

number of channels of each image.

channel_last

whether the images are channel_last format. Default: TRUE

batch_last

whether the batch is indexed in last dimension. Default: FALSE

ret.flatten

whether to return flatten image vectors. Default: FALSE

Details

The argument files can be either a list of files to load, or a list of which each element contains a list of files to load and concatenate by channel. The latter can be handy when data is provided in single-channel image files.

Value

a 4-d array.

Examples

1
2
3
dummy <- function(id) matrix(runif(64), 8, 8)
files <- list(c("f1_ch1", "f1_ch2", "f1_ch3"), c("f2_ch1", "f2_ch2", "f2_ch3"))
img <- LoadImageBatch(files, dummy, 8, 8, 3)

imlijunda/AwkwardMLTools documentation built on May 13, 2019, 11:33 a.m.