(img, filepath)
Save an image to filepath.

  It assumes `img` is a float numpy array with value in [0, 1]

  Args:
    img: a float numpy array with value in [0, 1] representing the image.
    filepath: a string of file path.
Save an image to filepath.
Save an image to filepath .
def save_image(img, filepath):
  """Save an image to filepath.

  It assumes `img` is a float numpy array with value in [0, 1]

  Args:
    img: a float numpy array with value in [0, 1] representing the image.
    filepath: a string of file path.
  """
  img = np.maximum(0, np.minimum(1, img))
  im = Image.fromarray(np.uint8(img * 255))
  im.save(filepath)
def save_image ( img , filepath ) : img = np . maximum ( 0 , np . minimum ( 1 , img ) ) im = Image . fromarray ( np . uint8 ( img * 255 ) ) im . save ( filepath )