ImageDataLoaders_from_name_re: ImageDataLoaders from name regex

View source: R/image_loaders.R

ImageDataLoaders_from_name_reR Documentation

ImageDataLoaders from name regex

Description

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

Usage

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


## 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 March 31, 2023, 11:41 p.m.