This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import tensorflow_datasets as tfds | |
from aug.autoaugment import distort_image_with_autoaugment | |
def aug_fn(sample, policy="v0"): | |
"""Apply an AutoAugment policy to a dataset sample. Make sure to check | |
the format of your dataset to call the distort function with the appropriate | |
arguments. bboxes should have format [y_min, x_min, y_max, x_max] with values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import albumentations | |
# load policy as transform based from downloaded json file | |
cifar10_transform = albumentations.load("cifar10_autoalbument.json") |