Skip to content

pikqu/AutoAugment-PyTorch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoAugment-PyTorch

Implementation of a PyTorch transform that mimics the ImageNet Augmentation Policy learned by AutoAugment, described in this Google AI Blogpost.

Examples of the best ImageNet Policy

Example of how to use

from aa_imagenet import AutoAugmentImageNetPolicy
data = ImageFolder(rootdir, transform=transforms.Compose(
                        [transforms.Resize(256), transforms.RandomResizedCrop(224), 
                         transforms.RandomHorizontalFlip(), AutoAugmentImageNetPolicy(), 
			 transforms.ToTensor(), transforms.Normalize(...)]))
loader = DataLoader(data, ...)

From the paper it is not exactly clear in what exact order to apply the preprocessing:

For baseline augmentation, we use the standard Inception-style pre-processing which involves scaling pixel values to [-1,1], horizontal flips with 50% probability, and random distortions of colors. For models trained with AutoAugment, we use the baseline pre-processing and the policy learned on ImageNet. We find that removing the random distortions of color does not change the results for AutoAugment.

Shear function adapted from Augmentor

About

Implementation of a PyTorch transform for all 24 sub-policies of AutoAugment for ImageNet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.9%
  • Python 0.1%