Skip to content

Instantly share code, notes, and snippets.

@surmenok
Last active February 24, 2018 20:34
Show Gist options
  • Select an option

  • Save surmenok/cf9118c47b0e038625a33341b1746042 to your computer and use it in GitHub Desktop.

Select an option

Save surmenok/cf9118c47b0e038625a33341b1746042 to your computer and use it in GitHub Desktop.
sz = 96
# Look at examples of image augmentation
def get_augs():
x,_ = next(iter(data.aug_dl))
return data.trn_ds.denorm(x)[1]
aug_tfms = [RandomRotate(20), RandomLighting(0.8, 0.8)]
tfms = tfms_from_model(arch, sz, aug_tfms=aug_tfms, max_zoom=1.2)
data = ImageClassifierData.from_paths(path, tfms=tfms, test_name='test')
ims = np.stack([get_augs() for i in range(6)])
plots(ims, rows=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment