Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ImageDataLoaders_from_name_re

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

Interface to 'fastai'

v2.0.7
Apache License 2.0
Authors
Turgut Abdullayev [ctb, cre, cph, aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.