Download DN_RGB/code/data/div2kjpeg.py from hyliu/lambdanet: direct link, hf CLI and curl.
- Browser
- Download file 695 Bytes
-
https://huggingface.co/hyliu/lambdanet/resolve/main/DN_RGB/code/data/div2kjpeg.py
- Command line
-
hf download hf://hyliu/lambdanet/DN_RGB/code/data/div2kjpeg.py
-
curl -L -o div2kjpeg.py https://huggingface.co/hyliu/lambdanet/resolve/main/DN_RGB/code/data/div2kjpeg.py
695 Bytes
| import os | |
| from data import srdata | |
| from data import div2k | |
| class DIV2KJPEG(div2k.DIV2K): | |
| def __init__(self, args, name='', train=True, benchmark=False): | |
| self.q_factor = int(name.replace('DIV2K-Q', '')) | |
| super(DIV2KJPEG, self).__init__( | |
| args, name=name, train=train, benchmark=benchmark | |
| ) | |
| def _set_filesystem(self, dir_data): | |
| self.apath = os.path.join(dir_data, 'DIV2K') | |
| self.dir_hr = os.path.join(self.apath, 'DIV2K_train_HR') | |
| self.dir_lr = os.path.join( | |
| self.apath, 'DIV2K_Q{}'.format(self.q_factor) | |
| ) | |
| if self.input_large: self.dir_lr += 'L' | |
| self.ext = ('.png', '.jpg') | |