Skip to content

Commit

Permalink
fixed the random rotation augmentation inconsistency (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherKotthoff authored Nov 22, 2024
1 parent b322c7b commit c983eda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions detectree2/models/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,8 @@ def build_train_loader(cls, cfg):

# Define basic augmentations including rotation and flipping
augmentations = [
T.RandomRotation(angle=[90, 90], expand=False),
T.RandomFlip(prob=0.4, horizontal=True, vertical=False),
T.RandomFlip(prob=0.4, horizontal=False, vertical=True),
T.RandomRotation(angle=[0, 360], expand=False),
T.RandomFlip(prob=0.5, horizontal=True, vertical=False),
]

# Additional augmentations for RGB images
Expand Down
5 changes: 2 additions & 3 deletions docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,8 @@ By default, random rotations and flips will be performed on input images.
.. code-block:: python
augmentations = [
T.RandomRotation(angle=[90, 90], expand=False),
T.RandomFlip(prob=0.4, horizontal=True, vertical=False),
T.RandomFlip(prob=0.4, horizontal=False, vertical=True),
T.RandomRotation(angle=[0, 360], expand=False),
T.RandomFlip(prob=0.5, horizontal=True, vertical=False),
]
If the input data is RGB, additional augmentations will be applied to adjust the brightness, contrast, saturation, and
Expand Down

0 comments on commit c983eda

Please sign in to comment.