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

Class gray_scale

EfficientViT/classification/data/threeaugment.py:56–68  ·  view source on GitHub ↗

Apply Solarization to the PIL image.

Source from the content-addressed store, hash-verified

54 return img
55
56class gray_scale(object):
57 """
58 Apply Solarization to the PIL image.
59 """
60 def __init__(self, p=0.2):
61 self.p = p
62 self.transf = transforms.Grayscale(3)
63
64 def __call__(self, img):
65 if random.random() < self.p:
66 return self.transf(img)
67 else:
68 return img
69
70
71

Callers 1

new_data_aug_generatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected