MCPcopy Create free account
hub / github.com/SLDGroup/EMCAD / RandomHorizontallyFlip

Class RandomHorizontallyFlip

utils/joint_transforms.py:62–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62class RandomHorizontallyFlip(object):
63 def __call__(self, img, mask):
64 if random.random() < 0.5:
65 return img.transpose(Image.FLIP_LEFT_RIGHT), mask.transpose(Image.FLIP_LEFT_RIGHT)
66 return img, mask
67
68
69class FreeScale(object):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected