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

Function TranslateXabs

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

Source from the content-addressed store, hash-verified

102
103
104def TranslateXabs(img, v): # [-150, 150] => percentage: [-0.45, 0.45]
105 assert 0 <= v
106 if random.random() > 0.5:
107 v = -v
108 return img.transform(img.size, PIL.Image.AFFINE, (1, 0, v, 0, 1, 0))
109
110
111def TranslateY(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