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

Function ShearY

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

Source from the content-addressed store, hash-verified

70
71
72def ShearY(img, v): # [-0.3, 0.3]
73 #assert -0.3 <= v <= 0.3
74 #if random.random() > 0.5:
75 # v = -v
76 return img.transform(img.size, PIL.Image.AFFINE, (1, 0, 0, v, 1, 0))
77
78
79def TranslateX(img, v): # [-150, 150] => percentage: [-0.45, 0.45]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected