Skip to content

Commit 1cc4e4e

Browse files
committed
replace use_hflip with use_flip
1 parent 18b8da4 commit 1cc4e4e

40 files changed

+47
-47
lines changed

basicsr/data/paired_image_dataset.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PairedImageDataset(data.Dataset):
3232
filename_tmpl (str): Template for each filename. Note that the
3333
template excludes the file extension. Default: '{}'.
3434
gt_size (int): Cropped patched size for gt patches.
35-
use_flip (bool): Use horizontal flips.
35+
use_hflip (bool): Use horizontal flips.
3636
use_rot (bool): Use rotation (use vertical flip and transposing h
3737
and w for implementation).
3838
@@ -86,7 +86,7 @@ def __getitem__(self, index):
8686
# random crop
8787
img_gt, img_lq = paired_random_crop(img_gt, img_lq, gt_size, scale, gt_path)
8888
# flip, rotation
89-
img_gt, img_lq = augment([img_gt, img_lq], self.opt['use_flip'], self.opt['use_rot'])
89+
img_gt, img_lq = augment([img_gt, img_lq], self.opt['use_hflip'], self.opt['use_rot'])
9090

9191
if 'color' in self.opt and self.opt['color'] == 'y':
9292
img_gt = rgb2ycbcr(img_gt, y_only=True)[..., None]

basicsr/data/reds_dataset.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class REDSDataset(data.Dataset):
4343
gt_size (int): Cropped patched size for gt patches.
4444
interval_list (list): Interval list for temporal augmentation.
4545
random_reverse (bool): Random reverse input frames.
46-
use_flip (bool): Use horizontal flips.
46+
use_hflip (bool): Use horizontal flips.
4747
use_rot (bool): Use rotation (use vertical flip and transposing h
4848
and w for implementation).
4949
@@ -182,9 +182,9 @@ def __getitem__(self, index):
182182
# augmentation - flip, rotate
183183
img_lqs.append(img_gt)
184184
if self.flow_root is not None:
185-
img_results, img_flows = augment(img_lqs, self.opt['use_flip'], self.opt['use_rot'], img_flows)
185+
img_results, img_flows = augment(img_lqs, self.opt['use_hflip'], self.opt['use_rot'], img_flows)
186186
else:
187-
img_results = augment(img_lqs, self.opt['use_flip'], self.opt['use_rot'])
187+
img_results = augment(img_lqs, self.opt['use_hflip'], self.opt['use_rot'])
188188

189189
img_results = img2tensor(img_results)
190190
img_lqs = torch.stack(img_results[0:-1], dim=0)
@@ -242,7 +242,7 @@ class REDSRecurrentDataset(data.Dataset):
242242
gt_size (int): Cropped patched size for gt patches.
243243
interval_list (list): Interval list for temporal augmentation.
244244
random_reverse (bool): Random reverse input frames.
245-
use_flip (bool): Use horizontal flips.
245+
use_hflip (bool): Use horizontal flips.
246246
use_rot (bool): Use rotation (use vertical flip and transposing h
247247
and w for implementation).
248248
@@ -345,7 +345,7 @@ def __getitem__(self, index):
345345

346346
# augmentation - flip, rotate
347347
img_lqs.extend(img_gts)
348-
img_results = augment(img_lqs, self.opt['use_flip'], self.opt['use_rot'])
348+
img_results = augment(img_lqs, self.opt['use_hflip'], self.opt['use_rot'])
349349

350350
img_results = img2tensor(img_results)
351351
img_gts = torch.stack(img_results[len(img_lqs) // 2:], dim=0)

basicsr/data/vimeo90k_dataset.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Vimeo90KDataset(data.Dataset):
4242
num_frame (int): Window size for input frames.
4343
gt_size (int): Cropped patched size for gt patches.
4444
random_reverse (bool): Random reverse input frames.
45-
use_flip (bool): Use horizontal flips.
45+
use_hflip (bool): Use horizontal flips.
4646
use_rot (bool): Use rotation (use vertical flip and transposing h
4747
and w for implementation).
4848
@@ -111,7 +111,7 @@ def __getitem__(self, index):
111111

112112
# augmentation - flip, rotate
113113
img_lqs.append(img_gt)
114-
img_results = augment(img_lqs, self.opt['use_flip'], self.opt['use_rot'])
114+
img_results = augment(img_lqs, self.opt['use_hflip'], self.opt['use_rot'])
115115

116116
img_results = img2tensor(img_results)
117117
img_lqs = torch.stack(img_results[0:-1], dim=0)
@@ -173,7 +173,7 @@ def __getitem__(self, index):
173173

174174
# augmentation - flip, rotate
175175
img_lqs.extend(img_gts)
176-
img_results = augment(img_lqs, self.opt['use_flip'], self.opt['use_rot'])
176+
img_results = augment(img_lqs, self.opt['use_hflip'], self.opt['use_rot'])
177177

178178
img_results = img2tensor(img_results)
179179
img_lqs = torch.stack(img_results[:7], dim=0)

docs/Config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ datasets:
7171
# Ground-Truth training patch size
7272
gt_size: 128
7373
# Whether to use horizontal flip. Here, flip is for horizontal flip
74-
use_flip: true
74+
use_hflip: true
7575
# Whether to rotate. Here for rotations with every 90 degree
7676
use_rot: true
7777

docs/Config_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ datasets:
7171
# 训练中Ground-Truth的Training patch的大小
7272
gt_size: 128
7373
# 是否使用horizontal flip, 这里的flip特指 horizontal flip
74-
use_flip: true
74+
use_hflip: true
7575
# 是否使用rotation, 这里指的是每隔90°旋转
7676
use_rot: true
7777

options/train/BasicVSR/train_BasicVSR_REDS.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
gt_size: 256
2323
interval_list: [1]
2424
random_reverse: false
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/BasicVSR/train_BasicVSR_Vimeo90K_BDx4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ datasets:
2020
gt_size: 256
2121
interval_list: [1]
2222
random_reverse: false
23-
use_flip: true
23+
use_hflip: true
2424
use_rot: true
2525
flip_sequence: true
2626

options/train/BasicVSR/train_BasicVSR_Vimeo90K_BIx4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ datasets:
2020
gt_size: 256
2121
interval_list: [1]
2222
random_reverse: false
23-
use_flip: true
23+
use_hflip: true
2424
use_rot: true
2525
flip_sequence: true
2626

options/train/BasicVSR/train_IconVSR_REDS.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
gt_size: 256
2323
interval_list: [1]
2424
random_reverse: false
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/BasicVSR/train_IconVSR_Vimeo90K_BDx4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ datasets:
2020
gt_size: 256
2121
interval_list: [1]
2222
random_reverse: false
23-
use_flip: true
23+
use_hflip: true
2424
use_rot: true
2525
flip_sequence: true
2626

options/train/BasicVSR/train_IconVSR_Vimeo90K_BIx4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ datasets:
2020
gt_size: 256
2121
interval_list: [1]
2222
random_reverse: false
23-
use_flip: true
23+
use_hflip: true
2424
use_rot: true
2525
flip_sequence: true
2626

options/train/ECBSR/train_ECBSR_x2_m4c16_prelu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ datasets:
1919
type: disk
2020

2121
gt_size: 128
22-
use_flip: true
22+
use_hflip: true
2323
use_rot: true
2424
color: y
2525

options/train/ECBSR/train_ECBSR_x4_m4c16_prelu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ datasets:
1919
type: lmdb
2020

2121
gt_size: 256
22-
use_flip: true
22+
use_hflip: true
2323
use_rot: true
2424
color: y
2525

options/train/ECBSR/train_ECBSR_x4_m4c16_prelu_RGB.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ datasets:
1919
type: lmdb
2020

2121
gt_size: 256
22-
use_flip: true
22+
use_hflip: true
2323
use_rot: true
2424

2525
# data loader

options/train/EDSR/train_EDSR_Lx2.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 96
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDSR/train_EDSR_Lx3.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 144
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDSR/train_EDSR_Lx4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 192
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDSR/train_EDSR_Mx2.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 96
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDSR/train_EDSR_Mx3.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 144
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDSR/train_EDSR_Mx4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 192
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDVR/train_EDVRM_woTSA_GAN_TODO.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ datasets:
2323
gt_size: 256
2424
interval_list: [1]
2525
random_reverse: false
26-
use_flip: true
26+
use_hflip: true
2727
use_rot: true
2828

2929
# data loader

options/train/EDVR/train_EDVR_L_x4_SR_REDS.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
gt_size: 256
2323
interval_list: [1]
2424
random_reverse: false
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDVR/train_EDVR_L_x4_SR_REDS_woTSA.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
gt_size: 256
2323
interval_list: [1]
2424
random_reverse: false
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDVR/train_EDVR_M_x4_SR_REDS.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
gt_size: 256
2323
interval_list: [1]
2424
random_reverse: false
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/EDVR/train_EDVR_M_x4_SR_REDS_woTSA.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
gt_size: 256
2323
interval_list: [1]
2424
random_reverse: false
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/ESRGAN/train_ESRGAN_x4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 128
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/ESRGAN/train_RRDBNet_PSNR_x4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ datasets:
2222
# type: lmdb
2323

2424
gt_size: 128
25-
use_flip: true
25+
use_hflip: true
2626
use_rot: true
2727

2828
# data loader

options/train/HiFaceGAN/train_hifacegan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ datasets:
2020
# type: lmdb
2121

2222
gt_size: 512
23-
use_flip: true
23+
use_hflip: true
2424
use_rot: false
2525

2626
# data loader

options/train/RCAN/train_RCAN_x2.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ datasets:
2323
# type: lmdb
2424

2525
gt_size: 96
26-
use_flip: true
26+
use_hflip: true
2727
use_rot: true
2828

2929
# data loader

options/train/SRResNet_SRGAN/train_MSRGAN_x4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ datasets:
2626
# type: lmdb
2727

2828
gt_size: 128
29-
use_flip: true
29+
use_hflip: true
3030
use_rot: true
3131

3232
# data loader

options/train/SRResNet_SRGAN/train_MSRResNet_x2.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ datasets:
2525
# type: lmdb
2626

2727
gt_size: 64
28-
use_flip: true
28+
use_hflip: true
2929
use_rot: true
3030

3131
# data loader

options/train/SRResNet_SRGAN/train_MSRResNet_x3.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ datasets:
2525
# type: lmdb
2626

2727
gt_size: 96
28-
use_flip: true
28+
use_hflip: true
2929
use_rot: true
3030

3131
# data loader

options/train/SRResNet_SRGAN/train_MSRResNet_x4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ datasets:
2626
# type: lmdb
2727

2828
gt_size: 128
29-
use_flip: true
29+
use_hflip: true
3030
use_rot: true
3131

3232
# data loader

options/train/SwinIR/train_SwinIR_SRx2_scratch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ datasets:
1818
type: disk
1919

2020
gt_size: 96
21-
use_flip: true
21+
use_hflip: true
2222
use_rot: true
2323

2424
# data loader

options/train/SwinIR/train_SwinIR_SRx4_scratch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ datasets:
1818
type: disk
1919

2020
gt_size: 192
21-
use_flip: true
21+
use_hflip: true
2222
use_rot: true
2323

2424
# data loader

options/train/VideoRecurrentGAN/train_VideoRecurrentGANModel_REDS.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ datasets:
2323
gt_size: 256
2424
interval_list: [1]
2525
random_reverse: false
26-
use_flip: true
26+
use_hflip: true
2727
use_rot: true
2828

2929
# data loader

test_scripts/test_paired_image_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def main(mode='folder'):
3434
opt['io_backend'] = dict(type='lmdb')
3535

3636
opt['gt_size'] = 128
37-
opt['use_flip'] = True
37+
opt['use_hflip'] = True
3838
opt['use_rot'] = True
3939

4040
opt['use_shuffle'] = True

test_scripts/test_reds_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def main(mode='folder'):
3535
opt['gt_size'] = 256
3636
opt['interval_list'] = [1]
3737
opt['random_reverse'] = True
38-
opt['use_flip'] = True
38+
opt['use_hflip'] = True
3939
opt['use_rot'] = True
4040

4141
opt['use_shuffle'] = True

0 commit comments

Comments
 (0)