MCPcopy Index your code
hub / github.com/microsoft/Cream / GaussianBlur

Class GaussianBlur

EfficientViT/classification/data/threeaugment.py:22–41  ·  view source on GitHub ↗

Apply Gaussian Blur to the PIL image.

Source from the content-addressed store, hash-verified

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

Callers 1

new_data_aug_generatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected