ImageDataLoaders_from_name_re: ImageDataLoaders from name regex

Description Usage Arguments Value Examples

View source: R/image_loaders.R

Description

Create from the name attrs of 'fnames' in 'path's with re expression 'pat'

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ImageDataLoaders_from_name_re(
  path,
  fnames,
  pat,
  bs = 64,
  val_bs = NULL,
  shuffle_train = TRUE,
  device = NULL,
  item_tfms = NULL,
  batch_tfms = NULL,
  ...
)

Arguments

path

The folder where to work

fnames

folder names

pat

an argument that requires regex

bs

The batch size

val_bs

The batch size for the validation DataLoader (defaults to bs)

shuffle_train

If we shuffle the training DataLoader or not

device

device name

item_tfms

One or several transforms applied to the items before batching them

batch_tfms

One or several transforms applied to the batches once they are formed

...

additional parameters to pass

Value

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

URLs_PETS()

path = 'oxford-iiit-pet'

dls = ImageDataLoaders_from_name_re(
path, fnames, pat='(.+)_\\d+.jpg$',
item_tfms = RandomResizedCrop(460, min_scale=0.75), bs = 10,
batch_tfms = list(aug_transforms(size = 299, max_warp = 0),
                  Normalize_from_stats( imagenet_stats() )
),
device = 'cuda'
)


## End(Not run)

fastai documentation built on July 28, 2021, 5:06 p.m.