Args: func: a function which takes an image array and return an augmented one coord_func: optional. A function which takes coordinates and return augmented ones. Coordinates should be Nx2 array of (x, y)s.
(self, func, coord_func=None)
| 102 | """ |
| 103 | |
| 104 | def __init__(self, func, coord_func=None): |
| 105 | """ |
| 106 | Args: |
| 107 | func: a function which takes an image array and return an augmented one |
| 108 | coord_func: optional. A function which takes coordinates and return augmented ones. |
| 109 | Coordinates should be Nx2 array of (x, y)s. |
| 110 | """ |
| 111 | super(MapImage, self).__init__() |
| 112 | self.func = func |
| 113 | self.coord_func = coord_func |
| 114 | |
| 115 | def get_transform(self, img): |
| 116 | if self.coord_func: |