Drop entire channel by replacing it with random solid value [0,1)
Type
Default
Details
p
float
0.1
Per-item probability
replace
float | None
None
Set constant replacement value. Defaults to element-wise random value [0,1)
with less_random(): _,axs = plt.subplots(1,3,figsize=(20,4)) f = ChannelDrop(p=1)for ax in axs: f(_batch(img.clone()), split_idx=0).squeeze().show(ctx=ax)
Utility function to easily create a list of affine transforms: flip, rotate, zoom, and warp.
Type
Default
Details
mult
float
1.0
Multiplication applying to max_rotate,max_warp
do_flip
bool
True
Random flipping
flip_vert
bool
False
Flip vertically and horizontally
max_rotate
float
10.0
Maximum degree of rotation
min_zoom
float
1.0
Minimum zoom
max_zoom
float
1.1
Maximum zoom
max_warp
float
0.2
Maximum warp
p_affine
float
0.75
Probability of applying affine transformation
xtra_tfms
list
None
Custom Transformations
size
int | tuple
None
Output size, duplicated if one value is specified
mode
str
bilinear
PyTorch F.grid_sample interpolation
pad_mode
str
reflection
A PadMode
align_corners
bool
True
PyTorch F.grid_sample align_corners
batch
bool
False
Apply identical transformation to entire batch
min_scale
float
1.0
Minimum scale of the crop, in relation to image area
affine_transforms identical to fastai.vision.augmentation.aug_transforms, except with the lighting transforms removed. It’s intended for use with the fastai+FFCV Loader, using FFCV Numba transforms for lighting.