MCPcopy Create free account
hub / github.com/carpedm20/DCGAN-tensorflow / transform

Function transform

utils.py:97–105  ·  view source on GitHub ↗
(image, input_height, input_width, 
              resize_height=64, resize_width=64, crop=True)

Source from the content-addressed store, hash-verified

95 return np.array(im.resize([resize_h, resize_w]), PIL.Image.BILINEAR)
96
97def 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
107def inverse_transform(images):
108 return (images+1.)/2.

Callers 1

get_imageFunction · 0.85

Calls 1

center_cropFunction · 0.85

Tested by

no test coverage detected