(self, data)
| 25 | self.height = kwargs.pop('height', 'width') |
| 26 | |
| 27 | def __call__(self, data): |
| 28 | import cv2 |
| 29 | image_path = data.get(self.path_field) |
| 30 | if not image_path: |
| 31 | return None |
| 32 | img = cv2.imread(image_path) |
| 33 | return { |
| 34 | 'image': |
| 35 | cv2.resize(img, |
| 36 | (data.get(self.height, 128), data.get(self.width, 128))) |
| 37 | } |
| 38 | |
| 39 | |
| 40 | class GenLocalFile: |