(self, data)
| 12 | self.image_shape = image_shape |
| 13 | |
| 14 | def __call__(self, data): |
| 15 | img = data['image'] |
| 16 | _, h, w = self.image_shape |
| 17 | # keep_aspect_ratio = False |
| 18 | image_pil = Image.fromarray(np.uint8(img)) |
| 19 | image = image_pil.resize((w, h), Image.LANCZOS) |
| 20 | image = np.array(image) |
| 21 | # rgb2gray = False |
| 22 | image = image.transpose((2, 0, 1)) |
| 23 | image = image.astype(np.float32) / 128.0 - 1.0 |
| 24 | data['image'] = image |
| 25 | data['valid_ratio'] = 1 |
| 26 | return data |
| 27 | |
| 28 | |
| 29 | class ABINetResize(object): |
nothing calls this directly
no outgoing calls
no test coverage detected