ESRGAN icon indicating copy to clipboard operation
ESRGAN copied to clipboard

Out of memor for .jpg images

Open growvv opened this issue 5 years ago • 2 comments

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)

growvv avatar Apr 09 '19 15:04 growvv

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.

xinntao avatar Apr 11 '19 15:04 xinntao

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

jose1711 avatar May 12 '20 14:05 jose1711