Skip to content

Commit

Permalink
Update augmentation.py
Browse files Browse the repository at this point in the history
Added the necessary documentation for the test_time_augmentation function
  • Loading branch information
haidarjomaa authored Dec 24, 2023
1 parent de65539 commit 2a70c67
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions data_processing/augmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
from skimage.measure import label as label_fn

def test_time_augmentation(data,i):
"""
Apply test-time augmentation to input data.
Args:
- data (torch.Tensor): Input data with shape (channels, height, width).
- i (int): Index specifying the augmentation type:
- 0: No flip
- 1: Flip along the last dimension
- 2: Flip along the second-to-last dimension
- 3: Flip along both dimensions
Returns:
- torch.Tensor: Augmented data.
"""
if i == 0:
x = data
elif i == 1:
Expand Down

1 comment on commit 2a70c67

@MhmdDimassi
Copy link
Collaborator

@MhmdDimassi MhmdDimassi commented on 2a70c67 Dec 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice doc @haidarjomaa,
I am wondering why the function name was test_time_augmentation,
We might change the function name because usually a function name that starts with test_ is to indicate that this is a test scenario.

Please sign in to comment.