MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / transform

Function transform

GAN/datadownloader/utils.py:24–29  ·  view source on GitHub ↗
(image, npx=64, is_crop=True, resize_w=64)

Source from the content-addressed store, hash-verified

22 return img
23
24def 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
31def inverse_transform(images):
32 return (images + 1.) / 2.

Callers 1

get_imageFunction · 0.70

Calls 1

center_cropFunction · 0.70

Tested by

no test coverage detected