zh320 / efficient-image-super-resolution-pytorch

PyTorch implementation of efficient image super-resolution models, e.g. SRCNN, ESPCN, FSRCNN, DRCN, VDSR, DRRN, EDSR, LapSRN, IDN, CARN etc.
9 stars 3 forks source link

How does this code separate HR from LR on val? #3

Open sogangAplus opened 2 months ago

sogangAplus commented 2 months ago

Thanks for sharing your code! In the sr_dataset.py, I see you distributed val file with scale factor. But I cannot find any code that detects HR image & LR image using image_SRF_upsacle file. And I can see that in the sr_base_dataset.py file > getitem -> there is a code for making lr image, and returns both hr & lr image. Which means in each epoch the code makes LR image during validation. The conclusion is, I want to know if your code makes LR image during every validation epoch, or if there is a code for separating LR&HR image so that I should put both LR and HR image inside image_SRF_upscale file. I'll wait for reply :)

zh320 commented 1 month ago

The reason why it has upscale factor for validation set is because the benchmark datasets have images with different resolution which may not be evenly divided by the upscale factor. Also different implementations for bicubic interpolation may produce slightly different results. In order to have deterministic results, these validation sets are resized to be compatible with different upscale factor using the same interpolation algorithm. If you do not care about benchmarks, there is no need to care about the separation of LR and HR. The LR are just generated from the HR using whatever (bicubic) interpolation unless you want to perform other types of degradation or something like blind super-resolution.

Best

oh-chainsmokers commented 1 month ago

Thank you~~