xinntao / ESRGAN

ECCV18 Workshops - Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution. The training codes are in BasicSR.
https://github.com/xinntao/BasicSR
Apache License 2.0
5.91k stars 1.05k forks source link

Out of memor for .jpg images #48

Open growvv opened 5 years ago

growvv commented 5 years ago

When I use a .jpg image to test, system tell me that it`s out of memory.(I run it in Google Colab with 11.7G memory)

xinntao commented 5 years ago

Image formats (jpg or png) do not matter.

If you test with large images, it will consume too much GPU memory. You may consider to first crop the images to several sub-images and then test on these sub-images. After testing, merge them to a large image.

But I think, 11.7G GPU memory is enough for most of the cases.

jose1711 commented 4 years ago

you may want to use imagemagick to split the file prior to processing and then put the images back together. here's an example:

convert "input.jpg" -crop 128x128 -set filename:tile "%[fx:page.y/128]_%[fx:page.x/128]" +repage +adjoin "tile-%[filename:tile].png"
python test.py
montage -mode concatenate -tile 3x3 result/tile*png output.jpg