ProjectiveTransforms
struct
defined in module
FastVision
ProjectiveTransforms(sz; [augmentations, buffered]) <: Encoding
Encoding for spatial data that resizes blocks to a common size
sz
and applies projective augmentations.
Encodes all spatial blocks, preserving the block type:
Image{N}
->
Image{N}
Mask{N}
->
Mask{N}
Keypoints{N}
->
Keypoints{N}
The behavior differs based on the
context
of encoding:
Resizes the data so the smallest side equals a side length in
sz
while keeping the aspect ratio.
Applies
augmentations
.
Crops a random
sz
-sized portion of the data
Resizes the data so the smallest side equals a side length in
sz
while keeping the aspect ratio.
Crops a
sz
-sized portion from the center.
Resizes the data so the smallest side equals a side length in
sz
while keeping the aspect ratio. Note that in this context, the data does not have size
sz
, since no cropping happens and aspect ratio is preserved.
ProjectiveTransforms
is not limited to 2D data, and works on 3D data as well. Note, however, that some transformations in
augs_projection
(rotation, warping, flipping) are 2D only so
augs_projection
cannot be used for 3D data.
augmentations::
DataAugmentation.Transform
= Identity()
: Projective augmentation to apply during training. See
augs_projection
.
buffered = true
: Whether to use inplace transformations. Reduces memory usage.
sharestate = true
: Whether to use the same random state and bounds for all blocks in a sample
There are
2
methods for FastVision.ProjectiveTransforms
:
The following pages link back here:
Blocks and encodings, How to augment vision data, Image segmentation, Introduction, Keypoint regression, Saving and loading models for inference, Siamese image similarity, fastai API comparison
FastVision.jl , encodings/projective.jl , tasks/classification.jl , tasks/keypointregression.jl , tasks/segmentation.jl , tests.jl