(image, input_height, input_width,
resize_height=64, resize_width=64, crop=True)
| 95 | return np.array(im.resize([resize_h, resize_w]), PIL.Image.BILINEAR) |
| 96 | |
| 97 | def transform(image, input_height, input_width, |
| 98 | resize_height=64, resize_width=64, crop=True): |
| 99 | if crop: |
| 100 | cropped_image = center_crop( |
| 101 | image, input_height, input_width, |
| 102 | resize_height, resize_width) |
| 103 | else: |
| 104 | im = Image.fromarray(image[j:j+crop_h, i:i+crop_w]) |
| 105 | return np.array(im.resize([resize_h, resize_w]), PIL.Image.BILINEAR)/127.5 - 1. |
| 106 | |
| 107 | def inverse_transform(images): |
| 108 | return (images+1.)/2. |
no test coverage detected