MCPcopy Create free account
hub / github.com/HYUNJS/SGT / RandomHue

Class RandomHue

projects/Datasets/Transforms/augmentation.py:24–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23
24class RandomHue(Augmentation):
25
26 def __init__(self, format, fraction=0.5, prob=0.5):
27 super().__init__()
28 self._init(locals())
29
30 def get_transform(self, img):
31 do = self._rand_range() < self.prob
32 if do:
33 S_rand, V_rand = random.random(), random.random()
34 return HueTransform(self.fraction, S_rand, V_rand, self.format)
35 else:
36 return NoOpTransform()
37
38class LetterBox(Augmentation):
39

Callers 2

build_transform_genFunction · 0.90
build_transform_genFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected