SHARE
TWEET

Untitled

a guest Jun 15th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MEANS = np.array([123.68, 116.779, 103.939]).reshape((1,1,1,3))
  2. def load_image(filename):
  3.  
  4.   image = cv2.imread(filename)
  5.   image = cv2.resize(image,(IMAGE_SIZE,IMAGE_SIZE))
  6.   cv2_imshow(image)
  7.   image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
  8.   image = image.reshape((1,)+image.shape)
  9.  
  10.   image = image - MEANS
  11.   return image
  12.  
  13. def save_image(image,filename):
  14.   image = image + MEANS
  15.   image = np.clip(image[0], 0, 255).astype('uint8')
  16.   scipy.misc.imsave(filename, image)
  17.   return image
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top