View source: R/image_loaders.R
ImageDataLoaders_from_name_re | R Documentation |
Create from the name attrs of 'fnames' in 'path's with re expression 'pat'
ImageDataLoaders_from_name_re(
path,
fnames,
pat,
bs = 64,
val_bs = NULL,
shuffle_train = TRUE,
device = NULL,
item_tfms = NULL,
batch_tfms = NULL,
...
)
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 |
None
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.