MCPcopy
hub / github.com/hustvl/Vim / gray_scale

Class gray_scale

vim/augment.py:63–75  ·  view source on GitHub ↗

Apply Solarization to the PIL image.

Source from the content-addressed store, hash-verified

61 return img
62
63class gray_scale(object):
64 """
65 Apply Solarization to the PIL image.
66 """
67 def __init__(self, p=0.2):
68 self.p = p
69 self.transf = transforms.Grayscale(3)
70
71 def __call__(self, img):
72 if random.random() < self.p:
73 return self.transf(img)
74 else:
75 return img
76
77
78

Callers 1

new_data_aug_generatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected