(self, image)
| 46 | return sample |
| 47 | |
| 48 | def to_np(self, image): |
| 49 | if isinstance(image[0], PIL.Image.Image): |
| 50 | return np.stack([np.array(i) for i in image], axis=0) |
| 51 | elif isinstance(image, torch.Tensor): |
| 52 | return image.cpu().numpy().transpose(0, 2, 3, 1) |
| 53 | return image |
| 54 | |
| 55 | def test_vae_image_processor_pt(self): |
| 56 | image_processor = VaeImageProcessor(do_resize=False, do_normalize=True) |
no test coverage detected