XPixelGroup / BasicSR

Open Source Image and Video Restoration Toolbox for Super-resolution, Denoise, Deblurring, etc. Currently, it includes EDSR, RCAN, SRResNet, SRGAN, ESRGAN, EDVR, BasicVSR, SwinIR, ECBSR, etc. Also support StyleGAN2, DFDNet.
https://basicsr.readthedocs.io/en/latest/
Apache License 2.0
6.71k stars 1.18k forks source link

folder file parser should be case insensitive #647

Open pokepress opened 11 months ago

pokepress commented 11 months ago

I kept running into an issue with this line in data_utils.py:

assert input_name in input_paths, f'{input_name} is not in {input_key}_paths.'

Because my HR and LR files had different casings on their extensions. Windows considers them equivalent (and changing it is more complicated than just editing the filename in Windows Explorer, as it will change the capitalization back), so I changed the code to:

assert input_name.casefold() in map(str.casefold, input_paths), f'{input_name} is not in {input_key}_paths.'

But there's probably a cleaner/more appropriate way to achieve this.