Skip to content

Commit

Permalink
adopt configs to new loops
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoXing1996 committed Feb 8, 2023
1 parent 9359f1b commit b3097dd
Show file tree
Hide file tree
Showing 49 changed files with 160 additions and 133 deletions.
2 changes: 1 addition & 1 deletion configs/_base_/datasets/basicvsr_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
]

# config for test
test_cfg = dict(type='MultiTestLoop')
test_cfg = dict(type='EditTestLoop')
test_dataloader = [
reds_dataloader,
vimeo_90k_bd_dataloader,
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/datasets/liif_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
] for scale in scale_test_list]

# test config
test_cfg = dict(type='MultiTestLoop')
test_cfg = dict(type='EditTestLoop')
test_dataloader = [
*set5_dataloaders,
*set14_dataloaders,
Expand Down
34 changes: 19 additions & 15 deletions configs/_base_/datasets/sisr_x2_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
data_root=set5_data_root,
data_prefix=dict(img='LRbicx2', gt='GTmod12'),
pipeline=test_pipeline))
set5_evaluator = [
dict(type='PSNR', crop_border=2, prefix='Set5'),
dict(type='SSIM', crop_border=2, prefix='Set5'),
]
set5_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='Set5'),
dict(type='SSIM', crop_border=4, prefix='Set5'),
])

set14_data_root = 'data/Set14'
set14_dataloader = dict(
Expand All @@ -44,10 +46,12 @@
data_root=set14_data_root,
data_prefix=dict(img='LRbicx2', gt='GTmod12'),
pipeline=test_pipeline))
set14_evaluator = [
dict(type='PSNR', crop_border=2, prefix='Set14'),
dict(type='SSIM', crop_border=2, prefix='Set14'),
]
set14_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='Set14'),
dict(type='SSIM', crop_border=4, prefix='Set14'),
])

# test config for DIV2K
div2k_data_root = 'data/DIV2K'
Expand All @@ -62,18 +66,18 @@
ann_file='meta_info_DIV2K100sub_GT.txt',
metainfo=dict(dataset_type='div2k', task_name='sisr'),
data_root=div2k_data_root,
# TODO: what this"
data_prefix=dict(
img='DIV2K_train_LR_bicubic/X2_sub', gt='DIV2K_train_HR_sub'),
# filename_tmpl=dict(img='{}_x2', gt='{}'),
pipeline=test_pipeline))
div2k_evaluator = [
dict(type='PSNR', crop_border=2, prefix='DIV2K'),
dict(type='SSIM', crop_border=2, prefix='DIV2K'),
]
div2k_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='DIV2K'),
dict(type='SSIM', crop_border=4, prefix='DIV2K'),
])

# test config
test_cfg = dict(type='MultiTestLoop')
test_cfg = dict(type='EditTestLoop')
test_dataloader = [
set5_dataloader,
set14_dataloader,
Expand Down
32 changes: 19 additions & 13 deletions configs/_base_/datasets/sisr_x3_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
data_root=set5_data_root,
data_prefix=dict(img='LRbicx3', gt='GTmod12'),
pipeline=test_pipeline))
set5_evaluator = [
dict(type='PSNR', crop_border=3, prefix='Set5'),
dict(type='SSIM', crop_border=3, prefix='Set5'),
]
set5_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='Set5'),
dict(type='SSIM', crop_border=4, prefix='Set5'),
])

set14_data_root = 'data/Set14'
set14_dataloader = dict(
Expand All @@ -44,10 +46,12 @@
data_root=set14_data_root,
data_prefix=dict(img='LRbicx3', gt='GTmod12'),
pipeline=test_pipeline))
set14_evaluator = [
dict(type='PSNR', crop_border=3, prefix='Set14'),
dict(type='SSIM', crop_border=3, prefix='Set14'),
]
set14_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='Set14'),
dict(type='SSIM', crop_border=4, prefix='Set14'),
])

# test config for DIV2K
div2k_data_root = 'data/DIV2K'
Expand All @@ -64,13 +68,15 @@
data_prefix=dict(
img='DIV2K_train_LR_bicubic/X3_sub', gt='DIV2K_train_HR_sub'),
pipeline=test_pipeline))
div2k_evaluator = [
dict(type='PSNR', crop_border=3, prefix='DIV2K'),
dict(type='SSIM', crop_border=3, prefix='DIV2K'),
]
div2k_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='DIV2K'),
dict(type='SSIM', crop_border=4, prefix='DIV2K'),
])

# test config
test_cfg = dict(type='MultiTestLoop')
test_cfg = dict(type='EditTestLoop')
test_dataloader = [
set5_dataloader,
set14_dataloader,
Expand Down
33 changes: 19 additions & 14 deletions configs/_base_/datasets/sisr_x4_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
data_root=set5_data_root,
data_prefix=dict(img='LRbicx4', gt='GTmod12'),
pipeline=test_pipeline))
set5_evaluator = [
dict(type='PSNR', crop_border=4, prefix='Set5'),
dict(type='SSIM', crop_border=4, prefix='Set5'),
]
set5_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='Set5'),
dict(type='SSIM', crop_border=4, prefix='Set5'),
])

set14_data_root = 'data/Set14'
set14_dataloader = dict(
Expand All @@ -44,10 +46,12 @@
data_root=set14_data_root,
data_prefix=dict(img='LRbicx4', gt='GTmod12'),
pipeline=test_pipeline))
set14_evaluator = [
dict(type='PSNR', crop_border=4, prefix='Set14'),
dict(type='SSIM', crop_border=4, prefix='Set14'),
]
set14_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='Set14'),
dict(type='SSIM', crop_border=4, prefix='Set14'),
])

# test config for DIV2K
div2k_data_root = 'data/DIV2K'
Expand All @@ -63,15 +67,16 @@
data_root=div2k_data_root,
data_prefix=dict(
img='DIV2K_train_LR_bicubic/X4_sub', gt='DIV2K_train_HR_sub'),
# filename_tmpl=dict(img='{}_x4', gt='{}'),
pipeline=test_pipeline))
div2k_evaluator = [
dict(type='PSNR', crop_border=4, prefix='DIV2K'),
dict(type='SSIM', crop_border=4, prefix='DIV2K'),
]
div2k_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', crop_border=4, prefix='DIV2K'),
dict(type='SSIM', crop_border=4, prefix='DIV2K'),
])

# test config
test_cfg = dict(type='MultiTestLoop')
test_cfg = dict(type='EditTestLoop')
test_dataloader = [
set5_dataloader,
set14_dataloader,
Expand Down
46 changes: 29 additions & 17 deletions configs/_base_/datasets/tdan_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@
num_input_frames=5,
pipeline=SPMC_pipeline))

SPMC_bd_evaluator = [
dict(type='PSNR', crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'),
dict(type='SSIM', crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'),
]
SPMC_bi_evaluator = [
dict(type='PSNR', crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'),
dict(type='SSIM', crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'),
]
SPMC_bd_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(
type='PSNR', crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'),
dict(
type='SSIM', crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'),
])
SPMC_bi_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(
type='PSNR', crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'),
dict(
type='SSIM', crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'),
])

# config for vid4
vid4_data_root = 'data/Vid4'
Expand Down Expand Up @@ -87,17 +95,21 @@
num_input_frames=5,
pipeline=vid4_pipeline))

vid4_bd_evaluator = [
dict(type='PSNR', convert_to='Y', prefix='VID4-BDx4-Y'),
dict(type='SSIM', convert_to='Y', prefix='VID4-BDx4-Y'),
]
vid4_bi_evaluator = [
dict(type='PSNR', convert_to='Y', prefix='VID4-BIx4-Y'),
dict(type='SSIM', convert_to='Y', prefix='VID4-BIx4-Y'),
]
vid4_bd_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', convert_to='Y', prefix='VID4-BDx4-Y'),
dict(type='SSIM', convert_to='Y', prefix='VID4-BDx4-Y'),
])
vid4_bi_evaluator = dict(
type='GenEvaluator',
metrics=[
dict(type='PSNR', convert_to='Y', prefix='VID4-BIx4-Y'),
dict(type='SSIM', convert_to='Y', prefix='VID4-BIx4-Y'),
])

# config for test
test_cfg = dict(type='MultiTestLoop')
test_cfg = dict(type='EditTestLoop')
test_dataloader = [
SPMC_bd_dataloader,
SPMC_bi_dataloader,
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/default_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
save_dir = './work_dirs'

default_hooks = dict(
timer=dict(type='IterTimerHook'),
timer=dict(type='GenIterTimerHook'),
logger=dict(type='LoggerHook', interval=100),
param_scheduler=dict(type='ParamSchedulerHook'),
checkpoint=dict(
Expand All @@ -24,7 +24,7 @@
)

log_level = 'INFO'
log_processor = dict(type='LogProcessor', window_size=100, by_epoch=False)
log_processor = dict(type='GenLogProcessor', window_size=100, by_epoch=False)

load_from = None
resume = False
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/gen_default_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
train_cfg = dict(by_epoch=False, val_begin=1, val_interval=10000)

# config for val
val_cfg = dict(type='GenValLoop')
val_cfg = dict(type='EditValLoop')
val_evaluator = dict(type='GenEvaluator')

# config for test
test_cfg = dict(type='GenTestLoop')
test_cfg = dict(type='EditTestLoop')
test_evaluator = dict(type='GenEvaluator')

# config for optim_wrapper_constructor
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/models/base_edvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@

train_cfg = dict(
type='IterBasedTrainLoop', max_iters=600_000, val_interval=5000)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

# optimizer
optim_wrapper = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/models/base_glean.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

train_cfg = dict(
type='IterBasedTrainLoop', max_iters=300_000, val_interval=5000)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

# optimizer
optim_wrapper = dict(
Expand Down
2 changes: 1 addition & 1 deletion configs/_base_/models/base_liif.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

train_cfg = dict(
type='IterBasedTrainLoop', max_iters=1_000_000, val_interval=3000)
val_cfg = dict(type='ValLoop')
val_cfg = dict(type='EditValLoop')

# optimizer
optim_wrapper = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/_base_/models/base_tof.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@

train_cfg = dict(
type='IterBasedTrainLoop', max_iters=1_000_000, val_interval=epoch_length)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

# optimizer
optim_wrapper = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/aot_gan/aot-gan_smpgan_4xb4_places-512x512.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
max_iters=500002,
val_interval=50000,
)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

# optimizer
optim_wrapper = dict(
Expand Down
2 changes: 1 addition & 1 deletion configs/basicvsr/basicvsr_2xb4_reds4.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

train_cfg = dict(
type='IterBasedTrainLoop', max_iters=300_000, val_interval=5000)
val_cfg = dict(type='ValLoop')
val_cfg = dict(type='EditValLoop')

# optimizer
optim_wrapper = dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
dict(type='SSIM'),
]

test_cfg = dict(type='TestLoop')
test_cfg = dict(type='EditTestLoop')
4 changes: 2 additions & 2 deletions configs/cain/cain_g1b32_1xb5_vimeo90k-triplet.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
test_evaluator = val_evaluator

train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=500)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

# optimizer
optim_wrapper = dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/deepfillv1/deepfillv1_4xb4_celeba-256x256.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
max_iters=1500003,
val_interval=250000,
)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

checkpoint = dict(
type='CheckpointHook', interval=250000, by_epoch=False, out_dir=save_dir)
4 changes: 2 additions & 2 deletions configs/deepfillv1/deepfillv1_8xb2_places-256x256.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
max_iters=5000003,
val_interval=250000,
)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

checkpoint = dict(
type='CheckpointHook', interval=250000, by_epoch=False, out_dir=save_dir)
4 changes: 2 additions & 2 deletions configs/deepfillv2/deepfillv2_8xb2_celeba-256x256.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
max_iters=500003,
val_interval=50000,
)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
val_cfg = dict(type='EditValLoop')
test_cfg = dict(type='EditTestLoop')

checkpoint = dict(
type='CheckpointHook', interval=50000, by_epoch=False, out_dir=save_dir)
Loading

0 comments on commit b3097dd

Please sign in to comment.