def postprocess(imgs, size, grayscale=False):
print("Postprocessing images and resize (at %d)" % size)
keyname = ('gray_%d' if grayscale else 'color_%d') % size
for img in imgs:
# Continue if already calculated
if img.isSetByName(keyname):
continue
floatimg = img_as_float(img.image)
floatimg = resize(floatimg, (size, size))
if grayscale:
floatimg = rgb2gray(floatimg)
img.setByName(keyname, floatimg) # expect to return floats
# Augment images
评论列表
文章目录