Utility func to easily create a list of flip, rotate, zoom, warp, lighting transforms.
aug_transforms(
mult = 1,
do_flip = TRUE,
flip_vert = FALSE,
max_rotate = 10,
min_zoom = 1,
max_zoom = 1.1,
max_lighting = 0.2,
max_warp = 0.2,
p_affine = 0.75,
p_lighting = 0.75,
xtra_tfms = NULL,
size = NULL,
mode = "bilinear",
pad_mode = "reflection",
align_corners = TRUE,
batch = FALSE,
min_scale = 1
)
ratio
to do flip
flip vertical or not
maximum rotation
minimum zoom
maximum zoom
maximum lighting
maximum warp
probability affine
probability lighting
extra transformations
size of image
mode
padding mode
align_corners
batch size
minimum scale
None
if (FALSE) {
URLs_PETS()
path = 'oxford-iiit-pet'
path_img = 'oxford-iiit-pet/images'
fnames = get_image_files(path_img)
dls = ImageDataLoaders_from_name_re(
path, fnames, pat='(.+)_.jpg$',
item_tfms=Resize(size = 460), bs = 10,
batch_tfms=list(aug_transforms(size = 224, min_scale = 0.75),
Normalize_from_stats( imagenet_stats() )
)
)
}