I’m updating my superres models based on Fastai v2, and I’m stuck on saving the final image.
After predicting, there are obvious clipping issues with the predictions. In v1, the solution was to do the following:
def save_img(img, fn):
x = np.minimum(np.maximum(image2tensor(img.data), 0), 255).astype(np.uint8)
PIL.Image.fromarray(x).save(fn)
These functions don’t exist anymore in v1, and PILImage.create(fn) is not doing the trick.
Anyone know what the equivalent solution is for v2?