(image, npx=64, is_crop=True, resize_w=64)
| 22 | return img |
| 23 | |
| 24 | def transform(image, npx=64, is_crop=True, resize_w=64): |
| 25 | if is_crop: |
| 26 | cropped_image = center_crop(image, npx, resize_w=resize_w) |
| 27 | else: |
| 28 | cropped_image = image |
| 29 | return (np.array(cropped_image) / 127.5) - 1. |
| 30 | |
| 31 | def inverse_transform(images): |
| 32 | return (images + 1.) / 2. |
no test coverage detected