MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / __call__

Method __call__

detrsmpl/data/datasets/pipelines/transforms.py:732–752  ·  view source on GitHub ↗
(self, results)

Source from the content-addressed store, hash-verified

730 self.saturation = saturation
731
732 def __call__(self, results):
733 brightness_factor = random.uniform(0, self.brightness)
734 contrast_factor = random.uniform(0, self.contrast)
735 saturation_factor = random.uniform(0, self.saturation)
736 color_jitter_transforms = [
737 dict(type='Brightness',
738 magnitude=brightness_factor,
739 prob=1.,
740 random_negative_prob=0.5),
741 dict(type='Contrast',
742 magnitude=contrast_factor,
743 prob=1.,
744 random_negative_prob=0.5),
745 dict(type='ColorTransform',
746 magnitude=saturation_factor,
747 prob=1.,
748 random_negative_prob=0.5)
749 ]
750 random.shuffle(color_jitter_transforms)
751 transform = Compose(color_jitter_transforms)
752 return transform(results)
753
754 def __repr__(self):
755 repr_str = self.__class__.__name__

Callers

nothing calls this directly

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected