Args: aug_lists (list): list of augmentors, or list of (augmentor, probability) tuples
(self, aug_lists)
| 44 | class RandomChooseAug(ImageAugmentor): |
| 45 | """ Randomly choose one from a list of augmentors """ |
| 46 | def __init__(self, aug_lists): |
| 47 | """ |
| 48 | Args: |
| 49 | aug_lists (list): list of augmentors, or list of (augmentor, probability) tuples |
| 50 | """ |
| 51 | if isinstance(aug_lists[0], (tuple, list)): |
| 52 | prob = [k[1] for k in aug_lists] |
| 53 | aug_lists = [k[0] for k in aug_lists] |
| 54 | self._init(locals()) |
| 55 | else: |
| 56 | prob = [1.0 / len(aug_lists)] * len(aug_lists) |
| 57 | self._init(locals()) |
| 58 | super(RandomChooseAug, self).__init__() |
| 59 | |
| 60 | def reset_state(self): |
| 61 | super(RandomChooseAug, self).reset_state() |