Skip to content

Commit

Permalink
Fix issue that slows down preprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
Eve-ning committed Jun 11, 2024
1 parent 8e17245 commit aa5292e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/model_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
RandomRotation,
RandomApply,
Resize,
RandomResizedCrop,
)
from torchvision.transforms.v2 import RandomHorizontalFlip

Expand Down Expand Up @@ -53,11 +54,12 @@ def rand_weak_aug(size: int):
[
ToImage(),
ToDtype(torch.float32, scale=True),
RandomResizedCrop(
size, scale=(0.08, 1.0), ratio=(0.95, 1.05), antialias=True
),
RandomHorizontalFlip(),
RandomVerticalFlip(),
RandomApply([RandomRotation((90, 90))], p=0.5),
Resize(size, antialias=True),
CenterCrop(size),
]
)

Expand All @@ -78,10 +80,11 @@ def rand_strong_aug(size: int):
[
ToImage(),
ToDtype(torch.float32, scale=True),
RandomResizedCrop(
size, scale=(0.08, 1.0), ratio=(0.9, 1.1), antialias=True
),
RandomHorizontalFlip(),
RandomVerticalFlip(),
RandomApply([RandomRotation((90, 90))], p=0.5),
Resize(size, antialias=True),
RandomCrop(size, pad_if_needed=False), # Strong
]
)

0 comments on commit aa5292e

Please sign in to comment.