MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / TranslateYabs

Function TranslateYabs

datasets/augmentation/randaugment.py:102–106  ·  view source on GitHub ↗
(img, v)

Source from the content-addressed store, hash-verified

100
101
102def TranslateYabs(img, v): # [-150, 150] => percentage: [-0.45, 0.45]
103 #assert 0 <= v
104 #if random.random() > 0.5:
105 # v = -v
106 return img.transform(img.size, PIL.Image.AFFINE, (1, 0, 0, 0, 1, v))
107
108
109def Solarize(img, v): # [0, 256]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected