Skip to content

Commit

Permalink
Docs: Affine - improve fit_output documentation (#1159)
Browse files Browse the repository at this point in the history
* Rewritten the description of `fit_output` argument for affine transformation.

* minor edit

* Fix flake8

Co-authored-by: Mikhail Druzhinin <dipetm@gmail.com>
  • Loading branch information
mys007 and Dipet committed Jun 16, 2022
1 parent a496f86 commit 0d98b4f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions albumentations/augmentations/geometric/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,11 @@ class Affine(DualTransform):
The value is only used when `mode=constant`. The expected value range is ``[0, 255]`` for ``uint8`` images.
cval_mask (number or tuple of number): Same as cval but only for masks.
mode (int): OpenCV border flag.
fit_output (bool): Whether to modify the affine transformation so that the whole output image is always
contained in the image plane (``True``) or accept parts of the image being outside
the image plane (``False``). This can be thought of as first applying the affine transformation
and then applying a second transformation to "zoom in" on the new image so that it fits the image plane,
This is useful to avoid corners of the image being outside of the image plane after applying rotations.
It will however negate translation and scaling.
fit_output (bool): If True, the image plane size and position will be adjusted to tightly capture
the whole image after affine transformation (`translate_percent` and `translate_px` are ignored).
Otherwise (``False``), parts of the transformed image may end up outside the image plane.
Fitting the output shape can be useful to avoid corners of the image being outside the image plane
after applying rotations. Default: False
keep_ratio (bool): When True, the original aspect ratio will be kept when the random scale is applied.
Default: False.
p (float): probability of applying the transform. Default: 0.5.
Expand Down

0 comments on commit 0d98b4f

Please sign in to comment.