def __init__(self): super(ComplexExamplePipeline, self).__init__() self.seq1 = aug.Sequential( self.affine_ops(), aug.Choice( aug.Stretch(p=.5, x_scale=aug.uniform(.25, .5), y_scale=aug.uniform(.25, .5)), aug.Rotation(p=.5, angle=aug.truncnorm(0., 5., 5., 10.))), aug.GaussianBlur(p=1), ) self.seq2 = aug.Sequential(aug.GaussianBlur(p=1), aug.GaussianBlur(p=1))
def __init__(self): super().__init__() self.seq = aug.Sequential( aug.PerspectiveDistortion(p=.5, max_warp=.12), aug.Choice( aug.GridDistortion(num_steps=(10, 10), distort_limit=(.6, 1.4)), # TODO expensive computationally # aug.ElasticTransformation(p=.25, alpha=aug.uniform(20., 120.), # sigma=aug.uniform(8, 20), # alpha_affine_range=aug.uniform(8., 10.)), ), aug.Rotation(p=.25, angle=aug.uniform(-5, 5), mode='replicate'), aug.Zoom(p=.5, margin=.1), )
import csv import cv2 import json import matplotlib.pyplot as plt import aug ops = [ aug.TextureModification(), aug.Scratches(), aug.PerspectiveDistortion(), aug.GridDistortion(), aug.OpticalDistortion(), aug.ElasticDistortion(), aug.Rotation(), aug.Rotation90(), aug.GaussNoise(), aug.JpegNoise(), aug.GlobalDarkness(), aug.Brightness(), aug.Clahe(), aug.Contrast(), aug.Gamma(), aug.PepperNoise(), aug.SaltNoise(), aug.ChannelShuffle(), aug.Inversion(), aug.RadialGradient(), aug.LinearGradient(), aug.Flashlight(),
def __init__(self): super(SimpleExample, self).__init__() self.seq = aug.Sequential( aug.Rotation(p=.5, angle=90), aug.GaussianBlur(p=1.), )
def affine_ops(self): return aug.Sequential( aug.Stretch(p=.5, x_scale=aug.uniform(.25, .5), y_scale=aug.uniform(.25, .5)), aug.Rotation(p=.5, angle=aug.truncnorm(0., 5., 5., 10.)))