未验证 提交 6cee870f 编写于 作者: L LielinJiang 提交者: GitHub

add realsr docs (#159)

上级 af98f013
......@@ -34,8 +34,8 @@ model:
dataset:
train:
name: SRDataset
gt_folder: data/realsr_preprocess/DF2K/generated/tdsr/HR_sub/
lq_folder: data/realsr_preprocess/DF2K/generated/tdsr/LR_sub/
gt_folder: data/DF2K/generated/tdsr/HR/
lq_folder: data/DF2K/generated/tdsr/LR/
num_workers: 4
batch_size: 16
scale: 4
......@@ -64,7 +64,7 @@ dataset:
std: [255., 255., 255.]
keys: [image, image]
- name: SRNoise
noise_path: data/realsr_preprocess/DF2K/Corrupted_noise/
noise_path: data/DF2K/Corrupted_noise/
size: 32
keys: [image]
test:
......
......@@ -34,8 +34,8 @@ model:
dataset:
train:
name: SRDataset
gt_folder: data/realsr_preprocess/DPED/generated/clean/train_tdsr/HR/
lq_folder: data/realsr_preprocess/DPED/generated/clean/train_tdsr/LR/
gt_folder: data/DPED/generated/clean/train_tdsr/HR/
lq_folder: data/DPED/generated/clean/train_tdsr/LR/
num_workers: 4
batch_size: 16
scale: 4
......@@ -64,7 +64,7 @@ dataset:
std: [255., 255., 255.]
keys: [image, image]
- name: SRNoise
noise_path: data/realsr_preprocess/DPED/DPEDiphone_noise/
noise_path: data/DPED/DPEDiphone_noise/
size: 32
keys: [image]
test:
......
......@@ -27,7 +27,8 @@ parser.add_argument('--upscale_factor',
opt = parser.parse_args()
# define input and target directories
with open('./preprocess/paths.yml', 'r') as stream:
cur_path = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(cur_path, './paths.yml'), 'r') as stream:
PATHS = yaml.load(stream)
......
......@@ -48,7 +48,8 @@ parser.add_argument('--upscale_factor',
opt = parser.parse_args()
# define input and target directories
with open('./paths.yml', 'r') as stream:
cur_path = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(cur_path, './paths.yml'), 'r') as stream:
PATHS = yaml.load(stream)
if opt.dataset == 'df2k':
......@@ -82,7 +83,8 @@ else:
tdsr_hr_dir = path_tdsr + 'HR'
tdsr_lr_dir = path_tdsr + 'LR'
assert not os.path.exists(PATHS['datasets'][opt.dataset])
assert not os.path.exists(tdsr_hr_dir)
assert not os.path.exists(tdsr_lr_dir)
if not os.path.exists(tdsr_hr_dir):
os.makedirs(tdsr_hr_dir)
......
df2k:
tdsr:
source: '/workspace/datasets/ntire20/Corrupted-tr-x'
target: '/workspace/datasets/ntire20/Corrupted-tr-y'
source: './data/ntire20/Corrupted-tr-x'
target: './data/ntire20/Corrupted-tr-y'
valid:
dped:
clean:
hr:
train: '/workspace/datasets/ntire20/DPEDiphone-tr-x'
valid: '/workspace/datasets/ntire20/DPEDiphone-va'
train: './data/ntire20/DPEDiphone-tr-x'
valid: './data/datasets/ntire20/DPEDiphone-va'
datasets:
df2k: 'DF2K'
dped: 'DPED'
df2k: 'data/DF2K'
dped: 'data/DPED'
......@@ -52,6 +52,16 @@
python data/process_div2k_data.py --data-root data/DIV2K
```
Prepare dataset for realsr df2k model:
Download dataset from [NTIRE 2020 RWSR](https://competitions.codalab.org/competitions/22220#participate) and unzip it to your path.
Unzip Corrupted-tr-x.zip and Corrupted-tr-y.zip to ``PaddleGAN/data/ntire20`` directory.
Run the following commands:
```
python ./data/realsr_preprocess/create_bicubic_dataset.py --dataset df2k --artifacts tdsr
python ./data/realsr_preprocess/collect_noise.py --dataset df2k --artifacts tdsr
```
### 1.2.2 Train/Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册