ZZZHANG-jx / DocRes

[CVPR 2024] DocRes: A Generalist Model Toward Unifying Document Image Restoration Tasks
MIT License
287 stars 26 forks source link

In inference.py, how does MAX_SIZE affect the result? #6

Closed 2OsZI4ISYd closed 2 months ago

2OsZI4ISYd commented 3 months ago

I've played around with a few different settings, and it appears to not change the resolution of the output image. However, I've noticed that a higher MAX_SIZE increases the quality of the output. I'm not an experienced programmer, so I can't really figure out what the constant does.

ZZZHANG-jx commented 3 months ago

The MAX_SIZE is used to limit the maximum size of the input image to prevent out-of-memory (OOM) issues caused by huge input image resolutions. The higher the MAX_SIZE, the more original details of the image can be retained, which generally results in better output quality. However, the output image will be resized back to the original dimensions, so MAX_SIZE does not affect the final output image resolution.