MCPcopy Create free account
hub / github.com/lingeringlight/START / GaussianBlur

Class GaussianBlur

augment.py:29–48  ·  view source on GitHub ↗

Apply Gaussian Blur to the PIL image.

Source from the content-addressed store, hash-verified

27
28
29class GaussianBlur(object):
30 """
31 Apply Gaussian Blur to the PIL image.
32 """
33 def __init__(self, p=0.1, radius_min=0.1, radius_max=2.):
34 self.prob = p
35 self.radius_min = radius_min
36 self.radius_max = radius_max
37
38 def __call__(self, img):
39 do_it = random.random() <= self.prob
40 if not do_it:
41 return img
42
43 img = img.filter(
44 ImageFilter.GaussianBlur(
45 radius=random.uniform(self.radius_min, self.radius_max)
46 )
47 )
48 return img
49
50class Solarization(object):
51 """

Callers 1

new_data_aug_generatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…