(self, dp)
| 208 | self.augs.reset_state() |
| 209 | |
| 210 | def _aug_mapper(self, dp): |
| 211 | dp = copy_mod.copy(dp) # always do a shallow copy, make sure the list is intact |
| 212 | copy_func = copy_mod.deepcopy if self._copy else lambda x: x # noqa |
| 213 | with self._exception_handler.catch(): |
| 214 | major_image = self._index[0] # image to be used to get params. TODO better design? |
| 215 | im = copy_func(dp[major_image]) |
| 216 | check_dtype(im) |
| 217 | tfms = self.augs.get_transform(im) |
| 218 | dp[major_image] = tfms.apply_image(im) |
| 219 | for idx in self._index[1:]: |
| 220 | check_dtype(dp[idx]) |
| 221 | dp[idx] = tfms.apply_image(copy_func(dp[idx])) |
| 222 | for idx in self._coords_index: |
| 223 | coords = copy_func(dp[idx]) |
| 224 | validate_coords(coords) |
| 225 | dp[idx] = tfms.apply_coords(coords) |
| 226 | return dp |
| 227 | |
| 228 | |
| 229 | try: |
nothing calls this directly
no test coverage detected