Skip to content

Instantly share code, notes, and snippets.

View agvdndor's full-sized avatar

Arne Vandendorpe agvdndor

  • ML6
  • Belgium
View GitHub Profile
import torch
import albumentations
# load policy as transform based from downloaded json file
cifar10_transform = albumentations.load("cifar10_autoalbument.json")
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