HAT icon indicating copy to clipboard operation
HAT copied to clipboard

Does HAT have tile mode?

Open ichsan2895 opened this issue 1 year ago • 7 comments

Hello, congratulation for getting highest score in "paperwithcode" benchmark summary. But, I curious with HAT, so I installed it.

I inference an image

!python hat/test.py -opt options/test/HAT_SRx4_ImageNet-LR.yml

But, it was errror because CUDA out of memory. I'm sorry because my VRAM only 2 GB. Yeah, I will try with google colab, but it has limited time and GPU quota.

Can HAT has a feature like tiling the image? for example !python hat/test.py -opt options/test/HAT_SRx4_ImageNet-LR.yml --tile 256

ichsan2895 avatar Sep 17 '22 01:09 ichsan2895

Hi @ichsan2895, I haven't integrated tile mode into this repo. I will add this function soon. Before that, you can try our method in the replicate.

chxy95 avatar Sep 17 '22 03:09 chxy95

The tile mode is provided for limited GPU memory when testing. The setting can be referred to https://github.com/XPixelGroup/HAT/blob/1d157411076a2d485b13c711a6a521abf62758b0/options/test/HAT_tile_example.yml#L7-L9

chxy95 avatar Sep 24 '22 18:09 chxy95

Something wrong.

I tested my image for get a psnr result.

I try test without tile ---> psnr 25.6524 I try test with tile -------> psnr 25.5012

something different the value of the psnr result.

Did you check the both results are same?

ziippy avatar Sep 30 '22 01:09 ziippy

@ziippy The tile mode will indeed cause slight performance change. The smaller the image size and the smaller the tile size, the greater the performance change. When your GPU can process the full image, I strongly recommend not to use the tile mode. Or you can set the tile size as large as possible.

chxy95 avatar Sep 30 '22 02:09 chxy95

The tile mode is provided for limited GPU memory when testing. The setting can be referred to

https://github.com/XPixelGroup/HAT/blob/1d157411076a2d485b13c711a6a521abf62758b0/options/test/HAT_tile_example.yml#L7-L9

wow thanks for that implementation, I will test it out later

ichsan2895 avatar Oct 03 '22 12:10 ichsan2895

Can you add tile settings in Replicate? Big images cause CUDA memory issues.

H19012 avatar Oct 06 '22 03:10 H19012