Skip to content

Commit

Permalink
fix the bug when using random erasing
Browse files Browse the repository at this point in the history
  • Loading branch information
ffiirree committed Nov 27, 2021
1 parent b61b11f commit 899e7b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cvm/utils/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,13 @@ def create_transforms(
elif augment == 'autoaugment':
ops.append(T.AutoAugment(autoaugment_policy))

if random_erasing > 0.0:
ops.append(T.RandomErasing(random_erasing))

ops.append(T.PILToTensor())
ops.append(T.ConvertImageDtype(torch.float))
ops.append(T.Normalize(mean, std))

if is_training and random_erasing > 0.0:
ops.append(T.RandomErasing(random_erasing))

return T.Compose(ops)


Expand Down

0 comments on commit 899e7b9

Please sign in to comment.