Args: ds (DataFlow): input DataFlow. augmentors (AugmentorList): a list of :class:`imgaug.ImageAugmentor` to be applied in order. index (int or str): the index or key of the image component to be augmented in the datapoint. copy (bool): Some a
(self, ds, augmentors, index=0, copy=True, catch_exceptions=False)
| 88 | """ |
| 89 | |
| 90 | def __init__(self, ds, augmentors, index=0, copy=True, catch_exceptions=False): |
| 91 | """ |
| 92 | Args: |
| 93 | ds (DataFlow): input DataFlow. |
| 94 | augmentors (AugmentorList): a list of :class:`imgaug.ImageAugmentor` to be applied in order. |
| 95 | index (int or str): the index or key of the image component to be augmented in the datapoint. |
| 96 | copy (bool): Some augmentors modify the input images. When copy is |
| 97 | True, a copy will be made before any augmentors are applied, |
| 98 | to keep the original images not modified. |
| 99 | Turn it off to save time when you know it's OK. |
| 100 | catch_exceptions (bool): when set to True, will catch |
| 101 | all exceptions and only warn you when there are too many (>100). |
| 102 | Can be used to ignore occasion errors in data. |
| 103 | """ |
| 104 | if isinstance(augmentors, AugmentorList): |
| 105 | self.augs = augmentors |
| 106 | else: |
| 107 | self.augs = AugmentorList(augmentors) |
| 108 | self._copy = copy |
| 109 | |
| 110 | self._exception_handler = ExceptionHandler(catch_exceptions) |
| 111 | super(AugmentImageComponent, self).__init__(ds, self._aug_mapper, index) |
| 112 | |
| 113 | def reset_state(self): |
| 114 | self.ds.reset_state() |
nothing calls this directly
no test coverage detected