DmitryUlyanov / deep-image-prior

Image restoration with neural networks but without learning.
https://dmitryulyanov.github.io/deep_image_prior
Other
7.9k stars 1.43k forks source link

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

Open mohammad-saber opened 5 years ago

mohammad-saber commented 5 years ago

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!

ghost commented 5 years ago

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

ABDOELSHEMY commented 5 years ago

@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