Ejemplo n.º 1
0
    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))
Ejemplo n.º 2
0
 def __init__(self):
     super().__init__()
     self.seq = aug.Choice(
         aug.MedianBlur(p=1., ksize_norm=aug.uniform(0., .006)),
         aug.GaussianBlur(p=1.,
                          ksize_norm=aug.uniform(.0, .05),
                          sigma=aug.uniform(1, 5)),
         aug.MotionBlur(p=1., ksize_norm=aug.uniform(.01, .04)),
         aug.Choice(
             aug.VariableBlur(p=1.,
                              ksize_norm=aug.uniform(.015, .005),
                              modes=('linear', )),
             aug.VariableBlur(p=1.,
                              ksize_norm=aug.uniform(.01, .005),
                              modes=('radial', ))))
Ejemplo n.º 3
0
def blurs():
    generate_gif("op_median_blur", [
        aug.MedianBlur(ksize_norm=i / 100.).apply(aug.Sample(
            lena.copy())).image for i in range(6)
    ])

    generate_gif("op_motion_blur", [
        aug.MotionBlur(ksize_norm=.08).apply(aug.Sample(lena.copy())).image
        for _ in range(6)
    ])

    generate_gif("op_gaussian_blur", [
        aug.GaussianBlur(ksize_norm=i / 100.).apply(aug.Sample(
            lena.copy())).image for i in range(6)
    ])

    generate_gif("op_variable_blur", [
        aug.VariableBlur(ksize_norm=.4, modes=('radial', 'linear')).apply(
            aug.Sample(lena.copy())).image for i in range(6)
    ])
Ejemplo n.º 4
0
    aug.CameraFlare(),
    aug.HaloEffect(),
    aug.Smudges(),
    aug.HorizontalFlip(),
    aug.VerticalFlip(),
    aug.Stretch(),
    aug.Transposition(),
    aug.BlendWithRandomImage(),
    aug.RandomRadialDirt(),
    aug.RandomShapeShadow(),
    aug.RandomCurveContour(),
    aug.Erosion(),
    aug.Dilation(),
    aug.RandomEdge(),
    aug.Pixelize(),
    aug.GaussianBlur(),
    aug.MedianBlur(),
    aug.VariableBlur(),
    aug.MotionBlur(),
]


def show(img):
    cv2.imshow('lena.jpg', img)
    cv2.waitKey()
    cv2.destroyAllWindows()


def main():
    img = cv2.imread('lena.jpg')
    results = {}
Ejemplo n.º 5
0
 def __init__(self):
     super(SimpleExample, self).__init__()
     self.seq = aug.Sequential(
         aug.Rotation(p=.5, angle=90),
         aug.GaussianBlur(p=1.),
     )