deep-image-prior icon indicating copy to clipboard operation
deep-image-prior copied to clipboard

"super-resolution.ipynb" , Problem in saving HR image onto disk.

Open mohammad-saber opened this issue 5 years ago • 2 comments

Hi,

"super-resolution.ipynb" uses "plot_image_grid" to show the original image, and HR image.

I tried to save the "out_HR_np" or "result_deep_prior" onto disk using following commands:

cv2.imwrite("HR.png", out_HR_np.transpose(1, 2, 0))
cv2.imwrite("Result.png", result_deep_prior.transpose(1, 2, 0))

However, what is saved is an image with only black color.

Do you have any idea how to save resulting image as png file?

Thanks!

mohammad-saber avatar Jul 05 '19 03:07 mohammad-saber

add line tensors_to_plot = torch.from_numpy( imgs['bicubic_np']) torchvision.utils.save_image(tensors_to_plot, 'test.png')

ghost avatar Aug 19 '19 12:08 ghost

@zxq2233 thanks for your code, it works great, but how we can save the super resolved image since your code save the bicubic one, 'HR-np' save the original croped one, and 'orig_np' save the original, what about super resolved image edit is HR image mean asuper resolved one

ABDOELSHEMY avatar Aug 21 '19 09:08 ABDOELSHEMY