MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / ShearY

Function ShearY

PATH/core/data/transforms/pedattr_transforms.py:89–93  ·  view source on GitHub ↗
(img, v)

Source from the content-addressed store, hash-verified

87
88
89def ShearY(img, v): # [-0.3, 0.3]
90 assert -0.3 <= v <= 0.3
91 if random.random() > 0.5:
92 v = -v
93 return img.transform(img.size, PIL.Image.AFFINE, (1, 0, 0, v, 1, 0))
94
95
96def TranslateX(img, v): # [-150, 150] => percentage: [-0.45, 0.45]

Callers

nothing calls this directly

Calls 1

transformMethod · 0.45

Tested by

no test coverage detected