ClassificationTransformsTrain

mail@pastecode.io avatar
unknown
python
a year ago
592 B
1
Indexable
Never
random_transforms = [T.AutoAugment(T.AutoAugmentPolicy.IMAGENET) ,
T.ColorJitter(brightness=.5, hue=.3),
T.GaussianBlur(kernel_size=(5, 9), sigma=(0.1, 5)),
T.RandomPosterize(bits=2),
T.RandomSolarize(threshold=192.0),
T.RandomAdjustSharpness(sharpness_factor=2),
T.RandomAutocontrast(),
T.RandomEqualize(),
T.AugMix(),
T.RandomInvert()]

trans.append(ResizeRandomCropCollageTrain(resize_size=train_resize_by_width, crop_size=train_crop_size, aspect_ratio_th=4))
trans.append(T.RandomChoice(transforms=random_transforms))
trans.append(T.RandomHorizontalFlip(hflip_prob))
t2 = T.Compose(trans)