INNER CODE UNIT · Python
save_image
Mukosame/Anime2Sketch · data.py:86
def save_image(image_numpy, image_path, output_resize=None):
"""Save a numpy image to the disk
Parameters:
image_numpy (numpy array) -- input numpy array
image_path (str) -- the path of the image
output_resize(None or tuple) -- the output size. If None, don't resize
"""
image_pil = Image.fromarray(image_numpy)
if output_resize:
image_pil = image_pil.resize(output_resize, bic)
image_pil.save(image_path)